-
Notifications
You must be signed in to change notification settings - Fork 670
Description
# from facebookads.adobjects.campaign import Campaign
# campaign = Campaign(...)
insights = campaign.get_insights()
print(insights) # => [<AdsInsights> { ... }]
insights.export_all_data() # AttributeError: 'Cursor' object has no attribute 'get_result'It seems that the Insights "edge" of the Campaigns object returns a Cursor, not AdsInsights so calling export_all_data errors, as this method does not exist. I assume the Cursor indicates that the library is still paginating, but I haven't been able to figure out how to extract the raw values as a dictionary or wait for the request to finish paginating (assuming that is what the Cursor is for). Printing insights in the above example does show seemingly legit properties on the class so I assume at least some data has been fetched from the API. How should I track completion of fetching insights and get an AdsInsights instance that I can call #export_all_data on or just get a dictionary of the values (end goal)?
PS: I've confirmed that this issue does not apply to all edges. For example,
# from facebookads.adobjects.user import User
# user = User(fbid=...)
accounts = user.get_accounts()
for account in accounts:
print(account.export_all_data()) # => { ... }