googleads / googleads-dfa-reporting-samples

Samples for the DoubleClick for Advertisers Reporting and Trafficking API
Apache License 2.0
106 stars 173 forks source link

Python sample code throws TypeError #98

Closed jpalladino84 closed 12 months ago

jpalladino84 commented 12 months ago

Problem

When using the Python sample scripts, every script throws a TypeError (see trace below)

python get_creatives.py  <profile_id> <advertiser_id>                                                                                                                  1 ↵ 
Traceback (most recent call last):
  File "get_creatives.py", line 72, in <module>
    main(sys.argv)
  File "get_creatives.py", line 50, in main
    request = service.creatives().list(
  File "python3.9/site-packages/googleapiclient/discovery.py", line 1071, in method
    for pvalue in pvalues:
TypeError: 'int' object is not iterable

Validation

I have used the get_userprofile.py script and it does in return successfully with my correct user so I don't believe this to be a issue with authenticate or authorization.

jpalladino84 commented 12 months ago

Found my answer here: https://github.com/googleapis/google-api-python-client/issues/2185#issuecomment-1629923156

I cast profile_id and advertiser_id to str and it works!