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
This repository was archived by the owner on Mar 17, 2020. It is now read-only.

Commit 31a1393

Browse filesBrowse files
authored
Update to google-cloud-bigquery version 1.7.0 (GoogleCloudPlatform#1821)
1 parent 201c193 commit 31a1393
Copy full SHA for 31a1393

File tree

Expand file treeCollapse file tree

2 files changed

+12
-9
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-9
lines changed
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-bigquery[pandas,pyarrow]==1.6.0
1+
google-cloud-bigquery[pandas,pyarrow]==1.7.0
22
pandas-gbq==0.7.0

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

Copy file name to clipboardExpand all lines: bigquery/pandas-gbq-migration/samples_test.py
+11-8Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@ def test_client_library_legacy_query():
9292
WHERE state = 'TX'
9393
LIMIT 100
9494
"""
95-
query_config = bigquery.QueryJobConfig()
96-
query_config.use_legacy_sql = True
95+
query_config = bigquery.QueryJobConfig(use_legacy_sql=True)
9796

98-
# Run a Standard SQL query using the environment's default project
9997
df = client.query(sql, job_config=query_config).to_dataframe()
10098
# [END bigquery_migration_client_library_query_legacy]
10199
assert len(df) > 0
@@ -128,11 +126,13 @@ def test_client_library_query_with_parameters():
128126
WHERE state = @state
129127
LIMIT @limit
130128
"""
131-
query_config = bigquery.QueryJobConfig()
132-
query_config.query_parameters = [
133-
bigquery.ScalarQueryParameter('state', 'STRING', 'TX'),
134-
bigquery.ScalarQueryParameter('limit', 'INTEGER', 100)
135-
]
129+
query_config = bigquery.QueryJobConfig(
130+
query_parameters=[
131+
bigquery.ScalarQueryParameter('state', 'STRING', 'TX'),
132+
bigquery.ScalarQueryParameter('limit', 'INTEGER', 100)
133+
]
134+
)
135+
136136
df = client.query(sql, job_config=query_config).to_dataframe()
137137
# [END bigquery_migration_client_library_query_parameters]
138138
assert len(df) > 0
@@ -165,6 +165,7 @@ def test_pandas_gbq_query_with_parameters():
165165
]
166166
}
167167
}
168+
168169
df = pandas.read_gbq(sql, configuration=query_config)
169170
# [END bigquery_migration_pandas_gbq_query_parameters]
170171
assert len(df) > 0
@@ -188,6 +189,7 @@ def test_client_library_upload_from_dataframe(temp_dataset):
188189
dataset_ref = client.dataset(temp_dataset.dataset_id)
189190
# [START bigquery_migration_client_library_upload_from_dataframe]
190191
table_ref = dataset_ref.table('new_table')
192+
191193
client.load_table_from_dataframe(df, table_ref).result()
192194
# [END bigquery_migration_client_library_upload_from_dataframe]
193195
client = bigquery.Client()
@@ -214,6 +216,7 @@ def test_pandas_gbq_upload_from_dataframe(temp_dataset):
214216
full_table_id = '{}.{}'.format(temp_dataset.dataset_id, table_id)
215217
project_id = os.environ['GCLOUD_PROJECT']
216218
# [START bigquery_migration_pandas_gbq_upload_from_dataframe]
219+
217220
df.to_gbq(full_table_id, project_id=project_id)
218221
# [END bigquery_migration_pandas_gbq_upload_from_dataframe]
219222
client = bigquery.Client()

0 commit comments

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