I noticed that if I pass a campaign that is new then it would break, as this is the response from apple:
{'data': {'reportingDataResponse': {'row': []}}, 'pagination': {'totalResults': 0, 'startIndex': 0, 'itemsPerPage': 0}, 'error': None}
and obviously there's no grandTotals which is mentioned in the apy.py, line 1429
res["data"]["reportingDataResponse"]["grandTotals"])
a quick solution is to add try and except