-
Notifications
You must be signed in to change notification settings - Fork 13
Tasks: Update queue, "x-goog-request-params" header #1
Comments
@alexcwatt I'm not sure of the semantics of calling the All that aside, I can see the source of the exception you are reporting. See: https://github.com/googleapis/google-cloud-python/blob/9e8bbb8ea3933dc0fc6a15da123476c12a9bb7e3/tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py#L613-L627 The code there successfully constructs an @lukesneeringer, @busunkim96 ISTM that any "message" arguments advertised as taking equivalent dictionaries ought to marshal such dictionaries into the equivalent message before use (even before passing to another message constructory). We can't fix this locally: it needs to happen in the I guess as an alternative, we could make all that icky generated |
@tseaver Yeah, this evening I was just trying to update the retry policy for a queue I had created earlier. For the sake of pinpointing the precise issue and noting that the exception isn't a function of any of the other arguments, and only has to do with the dictionary, I created the example that I did, but in my usage of the API earlier I used Prior to this work (last week), I had used |
One of the big reasons to use this API is that it seems to be idempotent whereas the
Thanks for the workaround |
Hmm, from a closer read this looks like it needs to be addressed in the generator. @software-dov could you take a look? |
Does this issue still exist in current version(s) of the library? Please comment if so, for fix, or close as obsolete. |
This was taken care of in googleapis/gapic-generator-python#401 and is not an issue in the latest version of the library. |
Environment details
Running google-cloud-tasks==1.2.1.
Steps to reproduce
Code example
Note: After I resolved this issue, I was using this to update the retry policy, but this is the simplest example to demonstrate the failure -- namely that update_queue doesn't actually work if a dictionary is provided for the queue, even though the type annotation says that the Union[dict, Queue] is supported.
Stack trace
Fortunately creating the Queue object resolves this but if the dict is not supported then the annotation should be updated and ideally there should be a nice error that lets the API user know that a dict isn't supported. Right now the AttributeError exception for accessing
.name
is silently passed but perhaps should be raised.The text was updated successfully, but these errors were encountered: