diff --git a/koku/masu/external/downloader/gcp/gcp_report_downloader.py b/koku/masu/external/downloader/gcp/gcp_report_downloader.py index e3802cb002..c8e44d0bff 100644 --- a/koku/masu/external/downloader/gcp/gcp_report_downloader.py +++ b/koku/masu/external/downloader/gcp/gcp_report_downloader.py @@ -284,9 +284,9 @@ def bigquery_export_to_partition_mapping(self): try: client = bigquery.Client() export_partition_date_query = f""" - SELECT DATE(_PARTITIONTIME), DATETIME(max(export_time)) FROM {self.table_name} + SELECT DATE(_PARTITIONTIME) AS partition_date, DATETIME(max(export_time)) FROM {self.table_name} WHERE DATE(_PARTITIONTIME) BETWEEN '{self.scan_start}' - AND '{self.scan_end}' GROUP BY DATE(_PARTITIONTIME) + AND '{self.scan_end}' GROUP BY partition_date ORDER BY partition_date """ eq_result = client.query(export_partition_date_query).result() for row in eq_result: