New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unrecognized fields when copying a field mask when trying to update a custom audience #454
Comments
Hey @caspercrause, can you try using the new fm = protobuf_helpers.field_mask(None, custom_audience._pb) # Field Mask
client.copy_from(custom_audience_operation.update_mask, fm) # Update Field Mask You may find this doc useful as well. Let us know how that works out! |
It looks like the issue here is that the field mask helper generates a field mask using custom_audience.type_ = 2
print(ca)
# type_: AUTO
fm = protobuf_helpers.field_mask(None, custom_audience)
print(fm)
# paths: "type_" This is incorrect behavior, I'll check with the proto-plus maintainers to see if this can be fixed. |
@BenRKarl Yes, this exactly. Thanks. |
I filed this bug with the team that maintains the generated layer for our library, hopefully they can provide some guidance. I'll leave this Issue open until that other bug is resolved. |
FYI the discussion around this is centering on this change to the # Wrapped CustomAudience instance
custom_audience.type_ = 2
print(ca)
# >>> type_: AUTO
# Native instance
native = custom_audience._pb
print(native)
# >>> type: AUTO
fm = protobuf_helpers.field_mask(None, custom_audience._pb)
print(fm)
# paths: "type" |
I'm sorry @BenRKarl but I cannot recreate the above. I still get my version of I might be missing something. |
@caspercrause sorry for the misunderstanding, my example is what the interface will likely be like. It's still currently in progress. I'll update this Issue once it's been fixed in this library. |
Here's a PR that will fix this issue. The solution that was landed on was to strip trailing underscores in the field mask helper. So there won't be any changes to the protobuf interface as I described above. Once that's published @caspercrause you should be able to install the latest version to fix this issue. At that point we'll update this library to set that version as the minimum. |
@BenRKarl Any updates on this? |
@caspercrause we're working on a new release that will set the minimum version of |
This issue is fixed in version |
Thanks so much for attending to this matter. All is working. Much appreciated! |
Describe the bug:
Attempted to update a custom audience, had to copy a field mask with
This created an invalid field called
type_
When attempting to mutate:
The following error occured:
Steps to Reproduce:
You will need to update an existing custom audience – currently there exists no such script – I created my own. It worked under google-ads==9.0.0 and API version (V6) bot not with API version (V8) and google-ads==12.0.0
But in short:
Expected behavior:
Client library version and API version:
Client library version:
12.0.0
Google Ads API version:
V8
packages_used.txt
Request/Response Logs:
logs.txt
Anything else we should know about your project / environment:
The text was updated successfully, but these errors were encountered: