Skip to content

Commit a2317a4

Browse files
tswastplamut
authored andcommitted
Update pandas/bqstorage samples to latest library changes. [(#2413)](#2413)
1 parent 42fe8a4 commit a2317a4

File tree

2 files changed

+12
-45
lines changed

2 files changed

+12
-45
lines changed

bigquery_storage/to_dataframe/jupyter_test.py

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ def test_jupyter_small_query(ipython):
7575
assert "stackoverflow" in ip.user_ns # verify that variable exists
7676

7777

78-
@pytest.mark.skipif(
79-
"TRAVIS" in os.environ, reason="Not running long-running queries on Travis"
80-
)
8178
def test_jupyter_tutorial(ipython):
8279
ip = IPython.get_ipython()
8380
ip.extension_manager.load_extension("google.cloud.bigquery")
@@ -86,33 +83,18 @@ def test_jupyter_tutorial(ipython):
8683
# speed-up of using the BigQuery Storage API to download the results.
8784
sample = """
8885
# [START bigquerystorage_jupyter_tutorial_query]
89-
%%bigquery nodejs_deps --use_bqstorage_api
90-
SELECT
91-
dependency_name,
92-
dependency_platform,
93-
project_name,
94-
project_id,
95-
version_number,
96-
version_id,
97-
dependency_kind,
98-
optional_dependency,
99-
dependency_requirements,
100-
dependency_project_id
101-
FROM
102-
`bigquery-public-data.libraries_io.dependencies`
103-
WHERE
104-
LOWER(dependency_platform) = 'npm'
105-
LIMIT 2500000
86+
%%bigquery tax_forms --use_bqstorage_api
87+
SELECT * FROM `bigquery-public-data.irs_990.irs_990_2012`
10688
# [END bigquerystorage_jupyter_tutorial_query]
10789
"""
10890
result = ip.run_cell(_strip_region_tags(sample))
10991
result.raise_error() # Throws an exception if the cell failed.
11092

111-
assert "nodejs_deps" in ip.user_ns # verify that variable exists
112-
nodejs_deps = ip.user_ns["nodejs_deps"]
93+
assert "tax_forms" in ip.user_ns # verify that variable exists
94+
tax_forms = ip.user_ns["tax_forms"]
11395

11496
# [START bigquerystorage_jupyter_tutorial_results]
115-
nodejs_deps.head()
97+
tax_forms.head()
11698
# [END bigquerystorage_jupyter_tutorial_results]
11799

118100
# [START bigquerystorage_jupyter_tutorial_context]
@@ -123,26 +105,11 @@ def test_jupyter_tutorial(ipython):
123105

124106
sample = """
125107
# [START bigquerystorage_jupyter_tutorial_query_default]
126-
%%bigquery java_deps
127-
SELECT
128-
dependency_name,
129-
dependency_platform,
130-
project_name,
131-
project_id,
132-
version_number,
133-
version_id,
134-
dependency_kind,
135-
optional_dependency,
136-
dependency_requirements,
137-
dependency_project_id
138-
FROM
139-
`bigquery-public-data.libraries_io.dependencies`
140-
WHERE
141-
LOWER(dependency_platform) = 'maven'
142-
LIMIT 2500000
108+
%%bigquery tax_forms
109+
SELECT * FROM `bigquery-public-data.irs_990.irs_990_2012`
143110
# [END bigquerystorage_jupyter_tutorial_query_default]
144111
"""
145112
result = ip.run_cell(_strip_region_tags(sample))
146113
result.raise_error() # Throws an exception if the cell failed.
147114

148-
assert "java_deps" in ip.user_ns # verify that variable exists
115+
assert "tax_forms" in ip.user_ns # verify that variable exists
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
google-auth==1.6.2
2-
google-cloud-bigquery-storage==0.6.0
3-
google-cloud-bigquery==1.17.0
4-
pyarrow==0.13.0
2+
google-cloud-bigquery-storage==0.7.0
3+
google-cloud-bigquery==1.20.0
4+
pyarrow==0.14.1
55
ipython==7.2.0
6-
pandas==0.24.2
6+
pandas==0.25.1

0 commit comments

Comments
 (0)