--- a/ckanext/ga_report/download_analytics.py +++ b/ckanext/ga_report/download_analytics.py @@ -304,6 +304,12 @@ max_results=10000, end_date=end_date).execute() result_data = results.get('rows') + if not result_data: + # We may not have data for this time period, so we need to bail + # early. + log.info("There is no download data for this time period") + return + # [[url, count], [url],count] data = {} for result in result_data: