Skip to content

Commit

Permalink
Fix typo in BQ Standard SQL samples. (#536)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tswast authored and Jon Wayne Parrott committed Sep 20, 2016
1 parent 293df6f commit 1e9a655
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bigquery/api/async_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def async_query(
'priority': 'BATCH' if batch else 'INTERACTIVE',
# Set to False to use standard SQL syntax. See:
# https://cloud.google.com/bigquery/sql-reference/enabling-standard-sql
'useLegacySQL': use_legacy_sql
'useLegacySql': use_legacy_sql
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions bigquery/api/async_query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def test_async_query(cloud_config, capsys):


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

main(
project_id=cloud_config.project,
Expand Down
2 changes: 1 addition & 1 deletion bigquery/api/sync_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def sync_query(
'timeoutMs': timeout,
# Set to False to use standard SQL syntax. See:
# https://cloud.google.com/bigquery/sql-reference/enabling-standard-sql
'useLegacySQL': use_legacy_sql
'useLegacySql': use_legacy_sql
}
return bigquery.jobs().query(
projectId=project_id,
Expand Down
4 changes: 1 addition & 3 deletions bigquery/api/sync_query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ def test_sync_query(cloud_config, capsys):


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

main(
project_id=cloud_config.project,
Expand Down

0 comments on commit 1e9a655

Please sign in to comment.