File tree Expand file tree Collapse file tree 11 files changed +24
-32
lines changed
appengine/standard_python3/bigquery Expand file tree Collapse file tree 11 files changed +24
-32
lines changed Original file line number Diff line number Diff line change 1
- google-cloud-bigquery == 1.28 .0
1
+ google-cloud-bigquery == 2.0 .0
2
2
Flask == 1.1.2
Original file line number Diff line number Diff line change 26
26
# other invocations of this tutorial. In practice, you could leverage
27
27
# a persistent dataset and not create/destroy it with each invocation.
28
28
dataset_id = "bqml_tutorial_{}" .format (str (uuid .uuid4 ().hex ))
29
+ full_dataset_id = "{}.{}" .format (client .project , dataset_id )
29
30
# [END bqml_data_scientist_tutorial_import_and_client]
30
31
31
32
32
33
@pytest .fixture
33
34
def delete_dataset ():
34
35
yield
35
- client .delete_dataset (
36
- client .dataset (dataset_id ), delete_contents = True )
36
+ client .delete_dataset (full_dataset_id , delete_contents = True )
37
37
38
38
39
39
def test_data_scientist_tutorial (delete_dataset ):
40
40
# [START bqml_data_scientist_tutorial_create_dataset]
41
- dataset = bigquery .Dataset (client . dataset ( dataset_id ) )
41
+ dataset = bigquery .Dataset (full_dataset_id )
42
42
dataset .location = 'US'
43
43
client .create_dataset (dataset )
44
44
# [END bqml_data_scientist_tutorial_create_dataset]
Original file line number Diff line number Diff line change 27
27
# other invocations of this tutorial. In practice, you could leverage
28
28
# a persistent dataset and not create/destroy it with each invocation.
29
29
dataset_id = "bqml_tutorial_{}" .format (str (uuid .uuid4 ().hex ))
30
+ full_dataset_id = "{}.{}" .format (client .project , dataset_id )
30
31
# [END bqml_ncaa_tutorial_import_and_client]
31
32
32
33
33
34
@pytest .fixture
34
35
def delete_dataset ():
36
+
35
37
yield
36
- client .delete_dataset (
37
- client .dataset (dataset_id ), delete_contents = True )
38
+ client .delete_dataset (full_dataset_id , delete_contents = True )
38
39
39
40
40
41
def test_ncaa_tutorial (delete_dataset ):
41
42
# [START bqml_ncaa_tutorial_create_dataset]
42
- dataset = bigquery .Dataset (client . dataset ( dataset_id ) )
43
+ dataset = bigquery .Dataset (full_dataset_id )
43
44
dataset .location = 'US'
44
45
client .create_dataset (dataset )
45
46
# [END bqml_ncaa_tutorial_create_dataset]
Original file line number Diff line number Diff line change
1
+ flaky==3.7.0
2
+ mock==4.0.2
1
3
pytest==6.0.1
Original file line number Diff line number Diff line change
1
+ google-cloud-bigquery [pandas,bqstorage ]== 2.0.0
2
+ google-cloud-bigquery-storage == 2.0.0
1
3
pandas == 1.1.3
2
- google-cloud-bigquery == 1.28.0
4
+ pyarrow == 1.0.1
3
5
flaky == 3.7.0
4
6
mock == 4.0.2
Original file line number Diff line number Diff line change 1
1
grpcio == 1.32.0
2
- google-cloud-bigquery [pandas,pyarrow ]== 1.28 .0
3
- google-cloud-bigquery-storage == 1.1 .0
2
+ google-cloud-bigquery [pandas,pyarrow ]== 2.0 .0
3
+ google-cloud-bigquery-storage == 2.0 .0
4
4
datalab == 1.2.0
5
- ipython == 7.13.0 ; python_version > "2.7"
6
- ipython <= 5.5 ; python_version == "2.7"
7
- google-cloud-monitoring == 1.1.0
5
+ ipython == 7.13.0
8
6
pyarrow == 1.0.1
Original file line number Diff line number Diff line change 1
- google-cloud-bigquery == 1.28.0
2
- google-cloud-bigquery-storage == 1.1.0
3
- pandas == 0.25.3 ; python_version > '3.0'
4
- pandas == 0.24.2 ; python_version < '3.0'
1
+ google-cloud-bigquery == 2.0.0
2
+ google-cloud-bigquery-storage == 2.0.0
3
+ pandas == 1.1.3
5
4
pandas-gbq == 0.14.0
6
5
pyarrow == 1.0.1
7
6
grpcio == 1.32.0
Original file line number Diff line number Diff line change @@ -83,23 +83,13 @@ def test_pandas_gbq_query():
83
83
84
84
def test_client_library_query_bqstorage ():
85
85
# [START bigquery_migration_client_library_query_bqstorage]
86
- import google .auth
87
86
from google .cloud import bigquery
88
- from google .cloud import bigquery_storage_v1beta1
89
87
90
- # Create a BigQuery client and a BigQuery Storage API client with the same
91
- # credentials to avoid authenticating twice.
92
- credentials , project_id = google .auth .default (
93
- scopes = ["https://www.googleapis.com/auth/cloud-platform" ]
94
- )
95
- client = bigquery .Client (credentials = credentials , project = project_id )
96
- bqstorage_client = bigquery_storage_v1beta1 .BigQueryStorageClient (
97
- credentials = credentials
98
- )
88
+ client = bigquery .Client ()
99
89
sql = "SELECT * FROM `bigquery-public-data.irs_990.irs_990_2012`"
100
90
101
91
# Use a BigQuery Storage API client to download results more quickly.
102
- df = client .query (sql ).to_dataframe (bqstorage_client = bqstorage_client )
92
+ df = client .query (sql ).to_dataframe (create_bqstorage_client = True )
103
93
# [END bigquery_migration_client_library_query_bqstorage]
104
94
assert len (df ) > 0
105
95
Original file line number Diff line number Diff line change 1
1
pytest==6.0.1
2
2
pandas==1.1.3
3
- google-cloud-bigquery==1.28 .0
3
+ google-cloud-bigquery==2.0 .0
4
4
pyarrow==1.0.1
Original file line number Diff line number Diff line change 3
3
#google-auth-httplib2==0.0.3
4
4
google-cloud-storage == 1.31.2
5
5
google-cloud-dataproc == 2.0.2
6
- google-cloud-bigquery == 1.28 .0
6
+ google-cloud-bigquery == 2.0 .0
Original file line number Diff line number Diff line change 1
1
google-cloud-storage == 1.31.2
2
- google-cloud-bigquery [pandas,pyarrow ]== 1.28 .0
2
+ google-cloud-bigquery [pandas,pyarrow ]== 2.0 .0
3
3
matplotlib == 3.1.2 ; python_version > '3.0'
4
4
matplotlib == 2.2.5 ; python_version < '3.0'
You can’t perform that action at this time.
0 commit comments