Fix handling of timestamps in BigQuery insert data method#1250
Merged
dhermes merged 2 commits intogoogleapis:masterfrom Dec 1, 2015
Merged
Fix handling of timestamps in BigQuery insert data method#1250dhermes merged 2 commits intogoogleapis:masterfrom
dhermes merged 2 commits intogoogleapis:masterfrom
Conversation
Contributor
Author
|
I just realized Bigtable has me trained too much. Wrote Bigquery instead of BigQuery in the commit messages. |
Contributor
Author
|
FWIW I cherry-picked the second commit onto head and ran the system test with the error reported by @kamatama41 and got the following: ======================================================================
ERROR: test_load_table_then_dump_table (bigquery.TestBigQuery)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".../gcloud-python/system_tests/bigquery.py", line 232, in test_load_table_then_dump_table
rows, _, _ = table.fetch_data()
File ".../gcloud-python/.tox/system-tests/local/lib/python2.7/site-packages/gcloud/bigquery/table.py", line 611, in fetch_data
rows_data = _rows_from_json(response.get('rows', ()), self._schema)
File ".../gcloud-python/.tox/system-tests/local/lib/python2.7/site-packages/gcloud/bigquery/_helpers.py", line 81, in _rows_from_json
row_data.append(converter(cell['v'], field))
File ".../gcloud-python/.tox/system-tests/local/lib/python2.7/site-packages/gcloud/bigquery/_helpers.py", line 42, in _datetime_from_json
return _datetime_from_microseconds(1e6 * float(value))
File ".../gcloud-python/.tox/system-tests/local/lib/python2.7/site-packages/gcloud/_helpers.py", line 235, in _datetime_from_microseconds
return _EPOCH + datetime.timedelta(microseconds=value)
OverflowError: date value out of range
----------------------------------------------------------------------
Ran 11 tests in 69.796s |
Contributor
|
LGTM. OK to merge w/ pylint failing on Travis, pending #1248. |
Contributor
Author
|
I'll just wait for #1248 |
As stated in the docs > BigQuery stores TIMESTAMP data internally as a > UNIX timestamp with microsecond precision > ...Specifies the number of seconds since the epoch.
Contributor
Author
|
@tseaver Assuming your LGTM still holds after rebasing. |
dhermes
added a commit
that referenced
this pull request
Dec 1, 2015
Fix handling of timestamps in BigQuery insert data method
|
Great job! Thank you for fixing quickly 😄 |
Contributor
Author
|
Sure thing. Thanks for reporting and finding the bug. |
parthea
pushed a commit
that referenced
this pull request
Jul 6, 2023
parthea
pushed a commit
that referenced
this pull request
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1247.