mixpanel / mixpanel-utils

Other
85 stars 62 forks source link

'NoneType' object is not iterable when when 'request_per_day=True' and date range contains days w/o data #11

Closed scott-marinoff closed 6 years ago

scott-marinoff commented 6 years ago

When using the 'request_per_day' and the 'timezone_offset' query params, get the following error if a day in the date range supplied does not contain data:

WARNING: /export API response empty Traceback (most recent call last): File "events_export.py", line 10, in mixpanel.export_events('events backup.json', {'from_date':'2016-08-30','to_date':'2018-03-05'}, format='json', timezone_offset=8, add_gzip_header=True, request_per_day=True) File "/usr/local/lib/python2.7/dist-packages/mixpanel_api/init.py", line 894, in export_events for event in events: TypeError: 'NoneType' object is not iterable

Without the 'timezone_offset' query params, get expected '/export API response empty' message.

jaredmixpanel commented 6 years ago

@scott-marinoff Thanks for the report. I think I know the problem, I'll get this fixed as soon as I can.