Skip to content

chore(deps): update dependency google-cloud-bigquery to v2 #4781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update pandas-gbq-migration samples
  • Loading branch information
tswast committed Oct 5, 2020
commit 713605b06221e5da4cdd35c30f341f90458a5d83
7 changes: 3 additions & 4 deletions bigquery/pandas-gbq-migration/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
google-cloud-bigquery==2.0.0
google-cloud-bigquery-storage==1.1.0
pandas==0.25.3; python_version > '3.0'
pandas==0.24.2; python_version < '3.0'
pandas-gbq==0.13.3
google-cloud-bigquery-storage==2.0.0
pandas==1.1.3
pandas-gbq==0.14.0
pyarrow==1.0.1
grpcio==1.32.0
14 changes: 2 additions & 12 deletions bigquery/pandas-gbq-migration/samples_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,13 @@ def test_pandas_gbq_query():

def test_client_library_query_bqstorage():
# [START bigquery_migration_client_library_query_bqstorage]
import google.auth
from google.cloud import bigquery
from google.cloud import bigquery_storage_v1beta1

# Create a BigQuery client and a BigQuery Storage API client with the same
# credentials to avoid authenticating twice.
credentials, project_id = google.auth.default(
scopes=["https://www.googleapis.com/auth/cloud-platform"]
)
client = bigquery.Client(credentials=credentials, project=project_id)
bqstorage_client = bigquery_storage_v1beta1.BigQueryStorageClient(
credentials=credentials
)
client = bigquery.Client()
sql = "SELECT * FROM `bigquery-public-data.irs_990.irs_990_2012`"

# Use a BigQuery Storage API client to download results more quickly.
df = client.query(sql).to_dataframe(bqstorage_client=bqstorage_client)
df = client.query(sql).to_dataframe(create_bqstorage_client=True)
# [END bigquery_migration_client_library_query_bqstorage]
assert len(df) > 0

Expand Down