Skip to content

Commit 1e9a655

Browse files
tswastJon Wayne Parrott
authored andcommitted
Fix typo in BQ Standard SQL samples. (#536)
The parameter is useLegacySql not useLegacySQL. See: https://code.google.com/p/google-bigquery/issues/detail?id=701 I also updated the tests to use a query that only works with standard SQL for those tests.
1 parent 293df6f commit 1e9a655

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

bigquery/api/async_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def async_query(
4444
'priority': 'BATCH' if batch else 'INTERACTIVE',
4545
# Set to False to use standard SQL syntax. See:
4646
# https://cloud.google.com/bigquery/sql-reference/enabling-standard-sql
47-
'useLegacySQL': use_legacy_sql
47+
'useLegacySql': use_legacy_sql
4848
}
4949
}
5050
}

bigquery/api/async_query_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def test_async_query(cloud_config, capsys):
3636

3737

3838
def test_async_query_standard_sql(cloud_config, capsys):
39-
query = (
40-
'SELECT corpus FROM publicdata.samples.shakespeare '
41-
'GROUP BY corpus;')
39+
query = 'SELECT [1, 2, 3] AS arr;' # Only valid in standard SQL
4240

4341
main(
4442
project_id=cloud_config.project,

bigquery/api/sync_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def sync_query(
3434
'timeoutMs': timeout,
3535
# Set to False to use standard SQL syntax. See:
3636
# https://cloud.google.com/bigquery/sql-reference/enabling-standard-sql
37-
'useLegacySQL': use_legacy_sql
37+
'useLegacySql': use_legacy_sql
3838
}
3939
return bigquery.jobs().query(
4040
projectId=project_id,

bigquery/api/sync_query_test.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ def test_sync_query(cloud_config, capsys):
3535

3636

3737
def test_sync_query_standard_sql(cloud_config, capsys):
38-
query = (
39-
'SELECT corpus FROM publicdata.samples.shakespeare '
40-
'GROUP BY corpus;')
38+
query = 'SELECT [1, 2, 3] AS arr;' # Only valid in standard SQL
4139

4240
main(
4341
project_id=cloud_config.project,

0 commit comments

Comments
 (0)