FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix handling of timestamps in BigQuery insert data method by dhermes · Pull Request #1250 · googleapis/google-cloud-python · GitHub

Fix handling of timestamps in BigQuery insert data method - #1250

Merged
dhermes merged 2 commits into
googleapis:masterfrom
dhermes:fix-1247
Dec 1, 2015
Merged

Fix handling of timestamps in BigQuery insert data method#1250
dhermes merged 2 commits into
googleapis:masterfrom
dhermes:fix-1247

Conversation

dhermes commented Nov 30, 2015

Copy link
Copy Markdown
Contributor

Fixes #1247.

dhermes added the api: bigquery Issues related to the BigQuery API. label Nov 30, 2015
googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 30, 2015
dhermes changed the title Fix handling of timestamps in Bigquery insert data method Fix handling of timestamps in BigQuery insert data method Nov 30, 2015

dhermes commented Nov 30, 2015

Copy link
Copy Markdown
Contributor Author

I just realized Bigtable has me trained too much. Wrote Bigquery instead of BigQuery in the commit messages.

dhermes commented Nov 30, 2015

Copy link
Copy Markdown
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

tseaver commented Nov 30, 2015

Copy link
Copy Markdown
Contributor

LGTM. OK to merge w/ pylint failing on Travis, pending #1248.

dhermes commented Nov 30, 2015

Copy link
Copy Markdown
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.

dhermes commented Dec 1, 2015

Copy link
Copy Markdown
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
dhermes merged commit b4e7534 into googleapis:master Dec 1, 2015
dhermes deleted the fix-1247 branch December 1, 2015 00:59

Copy link
Copy Markdown

Great job! Thank you for fixing quickly 😄

dhermes commented Dec 1, 2015

Copy link
Copy Markdown
Contributor Author

Sure thing. Thanks for reporting and finding the bug.

parthea pushed a commit that referenced this pull request Mar 9, 2026
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
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

Labels

api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL