googleads / googleads-python-lib

The Python client library for Google's Ads APIs
Apache License 2.0
681 stars 974 forks source link

Updating customTargeting on lineitems return an googleads.errors.GoogleAdsServerFault: Unmarshalling Error: cvc-type.2: The type definition cannot be abstract for element ns0:children. error #288

Closed lntho closed 6 years ago

lntho commented 6 years ago

Hello! I am trying to update some customTargeting on a lineitem via the API and I'm running into an error:

googleads.errors.GoogleAdsServerFault: Unmarshalling Error: cvc-type.2: The type definition cannot be abstract for element ns0:children.

Just to double check, I ran your example located here:

https://github.com/googleads/googleads-python-lib/blob/master/examples/dfp/v201805/line_item_service/target_custom_criteria.py

and I ran into the exact same error. I am running the latest version of officially released package 12.0.0

Thank you!

grivescorbett commented 6 years ago

Hi, thanks for writing in!

This looks like a bug due to the switch to the new SOAP library. It's not looking through for new values to instantiate when it gets a soap type vs a dictionary.

I'm working on a fix right now, but I'd suggest trying zeep.helpers.serialize_object on the returned objects before you mutate them to update.

grivescorbett commented 6 years ago

Update: I've found the problem and will try to bundle a fix with the upcoming AdWords release.

grivescorbett commented 6 years ago

Resolved in 12.1.0