You should ask the client library developers in the respective GitHub project.
For instance, the .NET libraries have the same problem, but somewhere deeply hidden in the report results was another class with an attribute listing all column names that were returned. You could ask if the python library has a similar feature. On Monday, September 28, 2020 at 2:19:30 PM UTC+2, Watanabe, Deny (SPL-MEW) wrote: > > 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] > <javascript:>> > *Sent:* Friday, September 25, 2020 5:39 PM > *To:* Watanabe, Deny (SPL-MEW) <[email protected] <javascript:>> > *Cc:* [email protected] <javascript:> > *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 > > > > 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/107ed29d-a969-46b2-a882-ab615222ef44o%40googlegroups.com.
