Hi Ben,

I’m using the python library and was very disappointed to find out that the 
results from the API queries are delivered as objects which are non-iterable, 
making the use of data dictionaries a lot more difficult and a lot less elegant.

Other Google APIs present results as dictionaries which can be inspected for 
content (fields and values) according to the same data dictionary that was used 
for the request. That makes configuring API extractions easy to build, maintain 
and improve, using code such as:

for element in my_api_dict:
  if element[“id”] in returned_values:
    results.append(returned_values[element[“id”]]

On the other hand, the new Google Ads API (which should supposedly be better 
than previous ones?) demands that the result set elements are named explicitly, 
like:
results = [returned_values.table1.column1,
  returned_values.table1.column2,
  returned_values.table1.column3, …
]

I feel very dirty to admit I came up with a fugly and shameful solution which 
is converting the results to string and then making some modifications to turn 
it into a yaml string and parse it, so I could transform it into a dictionary. 
Ugly solutions make me extremely uncomfortable and frustrated, and I don’t 
think I should have to do things like this in 2020, *especially* dealing with 
an API developed by the almighty Google.

I can live with the ugly solution if you can live with my deep disappointment 
in your company development teams.

Cheers,
Deny

From: Google Ads API Forum Advisor Prod <[email protected]>
Sent: Friday, September 25, 2020 5:39 PM
To: Watanabe, Deny (SPL-MEW) <[email protected]>
Cc: [email protected]
Subject: [EXTERNAL] RE: GoogleAdsRow object not iterable?


Hi Deny,

Thanks for the post, and sorry that you're having an issue here.

Can you share a little more detail about the problem you're having? I might be 
able to help you get around the issue, and if not can help post a feature 
request so that we can fix it in the future.

It seems like you might be having an issue with one of the client libraries. 
Can you let me know which language you're using?

Thanks!
Ben Karl, Google Ads API Team
[https://google-dev-relations.my.salesforce.com/servlet/servlet.ImageServer?oid=00D1U000001174p&esid=0184Q00001A4ZEA]

ref:_00D1U1174p._5004Q25Wv5e:ref

This message contains information which may be confidential and privileged. 
Unless you are the intended recipient (or authorized to receive this message 
for the intended recipient), you may not use, copy, disseminate or disclose to 
anyone the message or any information contained in the message.  If you have 
received the message in error, please advise the sender by reply e-mail, and 
delete the message.  Thank you very much.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/MN2PR06MB61424C5E9DF0CD5CCFDBD708FD350%40MN2PR06MB6142.namprd06.prod.outlook.com.

Reply via email to