[
https://issues.apache.org/jira/browse/AIRFLOW-2573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joy Gao resolved AIRFLOW-2573.
------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0
Issue resolved by pull request #3471
[https://github.com/apache/incubator-airflow/pull/3471]
> Cast TIMESTAMP field to float rather than int
> ---------------------------------------------
>
> Key: AIRFLOW-2573
> URL: https://issues.apache.org/jira/browse/AIRFLOW-2573
> Project: Apache Airflow
> Issue Type: Bug
> Reporter: Hongyi Wang
> Assignee: Hongyi Wang
> Priority: Blocker
> Fix For: 2.0.0
>
>
> In current bigquery_hook.py, we have a `_bq_cast(string_field, bq_type)`
> function that help casts a BigQuery row to the appropriate data types.
> {quote}elif bq_type == 'INTEGER' or bq_type == 'TIMESTAMP':
> return int(string_field)
> {quote}
> However, when a bq_type equals to 'TIMESTAMP', it causes ValueError.
> {quote}>>> int('1.458668898E9')
> ValueError: invalid literal for int() with base 10: '1.458668898E9'
> {quote}
> Because 'TIMESTAMP' in bigquery is stored as double in python, thus should be
> cast to float instead.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)