Repository: incubator-airflow Updated Branches: refs/heads/master 1c8e5808d -> 016c0665d
[AIRFLOW-2573] Cast BigQuery TIMESTAMP field to float Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/f51db193 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/f51db193 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/f51db193 Branch: refs/heads/master Commit: f51db193c37a7caadae56885bd0bca5045e33711 Parents: b8487cd Author: Hongyi Wang <[email protected]> Authored: Wed Jun 6 14:26:20 2018 -0700 Committer: Hongyi Wang <[email protected]> Committed: Wed Jun 6 14:26:20 2018 -0700 ---------------------------------------------------------------------- airflow/contrib/hooks/bigquery_hook.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/f51db193/airflow/contrib/hooks/bigquery_hook.py ---------------------------------------------------------------------- diff --git a/airflow/contrib/hooks/bigquery_hook.py b/airflow/contrib/hooks/bigquery_hook.py index bddc2ef..3fc0b37 100644 --- a/airflow/contrib/hooks/bigquery_hook.py +++ b/airflow/contrib/hooks/bigquery_hook.py @@ -1450,9 +1450,9 @@ def _bq_cast(string_field, bq_type): """ if string_field is None: return None - elif bq_type == 'INTEGER' or bq_type == 'TIMESTAMP': + elif bq_type == 'INTEGER': return int(string_field) - elif bq_type == 'FLOAT': + elif bq_type == 'FLOAT' or bq_type == 'TIMESTAMP': return float(string_field) elif bq_type == 'BOOLEAN': assert string_field in set(['true', 'false'])
