Bug: datetime logic in copy_deduplicate

Closes https://github.com/mozilla/bigquery-etl/issues/376

Addition to datetime.date considers only the days part of a timedelta,
so we have to convert to a timestamp first.
This commit is contained in:
Jeff Klukas 2019-09-24 09:53:01 -04:00
Родитель 5aecb85a37
Коммит 29f44ebbf5
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -238,7 +238,8 @@ def get_query_job_configs(client, stable_table, date, dry_run, hourly, priority)
if hourly:
stable_table = client.get_table(stable_table)
for hour in range(24):
value = (date + timedelta(hours=hour)).isoformat()
dt = (datetime(*date.timetuple()[:6]) + timedelta(hours=hour))
value = dt.isoformat()
yield bigquery.QueryJobConfig(
destination=get_temporary_table(
client=client,