BigQuery python cli fails to change time, BUT does changes timezone for TIMESTAMP which leads to an incorrect time #476
Labels
api: bigquery
Issues related to the googleapis/python-bigquery API.
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
This code works with with the python package
google-cloud-bigquery==2.2.0
but it does not work with this package
google-cloud-bigquery==2.6.0
What you expected to happen:
I expect the client library to take a datetime of
'2017-11-01 04:08 AM -07:00' and convert it to
'2017-11-01 11:08 AM -00:00' in big query. but instead it uploads it to
'2017-11-01 04:08 AM -00:00'
Steps to reproduce:
Other info
I worked with the google BigQuery team and here is their feedback.
Hello,
I have been investigating the issue you described and it seems like this change of behaviour of the python client library was introduced in the version 2.5.0 1 with the pull request #393 2, whose objective was to fix a previous issue with floating points and timestamps in the method
insert_rows
.I have been able to reproduce your issue in new versions after 2.5.0 while it does not happen in the previous ones. The suggested way to proceed here would be to open an issue in the Github repository 3 so you can transmit your findings to the Engineering Team, since the code is open source .
Alternatively, you might want to add the following line of code, so the timezone is converted to UTC before trying to insert the row into BigQuery. Please let me know if this workaround worked for you:
We will look into the feasibility of the workaround
The text was updated successfully, but these errors were encountered: