Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 780fa4f

Browse filesBrowse files
authored
docs(bigquery): comment that the BQ Storage API is used by default (GoogleCloudPlatform#5700)
There are several conditions that must be satisfied, otherwise the client library will fallback to `tabledata.list()` or `jobs.getQueryResults()`. ## Description Fixes #<ISSUE-NUMBER> Note: It's a good idea to open an issue first for discussion. ## Checklist - [ ] I have followed [Sample Guidelines from AUTHORING_GUIDE.MD](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md) - [ ] README is updated to include [all relevant information](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#readme-file) - [x] **Tests** pass: `nox -s py-3.6` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup)) - [x] **Lint** pass: `nox -s lint` (see [Test Environment Setup](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/AUTHORING_GUIDE.md#test-environment-setup)) - [ ] These samples need a new **API enabled** in testing projects to pass (let us know which ones) - [ ] These samples need a new/updated **env vars** in testing projects set to pass (let us know which ones) - [x] Please **merge** this PR for me once it is approved. - [ ] This sample adds a new sample directory, and I updated the [CODEOWNERS file](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/.github/CODEOWNERS) with the codeowners for this sample
1 parent 2996ab4 commit 780fa4f
Copy full SHA for 780fa4f

File tree

Expand file treeCollapse file tree

2 files changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-3
lines changed

‎bigquery/pandas-gbq-migration/requirements.txt

Copy file name to clipboardExpand all lines: bigquery/pandas-gbq-migration/requirements.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
google-cloud-bigquery==2.13.1
22
google-cloud-bigquery-storage==2.4.0
33
pandas==1.1.5; python_version < '3.7'
4-
pandas==1.2.0; python_version > '3.6'
4+
pandas==1.2.4; python_version > '3.6'
55
pandas-gbq==0.15.0; python_version > '3.6'
66
pandas-gbq==0.14.1; python_version < '3.7'
77
pyarrow==3.0.0

‎bigquery/pandas-gbq-migration/samples_test.py

Copy file name to clipboardExpand all lines: bigquery/pandas-gbq-migration/samples_test.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,11 @@ def test_client_library_query_bqstorage():
8888
client = bigquery.Client()
8989
sql = "SELECT * FROM `bigquery-public-data.irs_990.irs_990_2012`"
9090

91-
# Use a BigQuery Storage API client to download results more quickly.
92-
df = client.query(sql).to_dataframe(create_bqstorage_client=True)
91+
# The client library uses the BigQuery Storage API to download results to a
92+
# pandas dataframe if the API is enabled on the project, the
93+
# `google-cloud-bigquery-storage` package is installed, and the `pyarrow`
94+
# package is installed.
95+
df = client.query(sql).to_dataframe()
9396
# [END bigquery_migration_client_library_query_bqstorage]
9497
assert len(df) > 0
9598

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.