From 192b5ce690dd75d71036aab6944fbe8982db2e2e Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Mon, 19 Sep 2016 13:01:34 -0700 Subject: [PATCH] Typo in BQ Standard SQL samples. The parameter is useLegacySql not useLegacySQL. See: https://code.google.com/p/google-bigquery/issues/detail?id=701 I also update the tests to use a query that only works with standard SQL for those tests. --- bigquery/api/async_query.py | 2 +- bigquery/api/async_query_test.py | 4 +--- bigquery/api/sync_query.py | 2 +- bigquery/api/sync_query_test.py | 4 +--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bigquery/api/async_query.py b/bigquery/api/async_query.py index e97cf396928..3e41aa2f9f6 100755 --- a/bigquery/api/async_query.py +++ b/bigquery/api/async_query.py @@ -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 } } } diff --git a/bigquery/api/async_query_test.py b/bigquery/api/async_query_test.py index 16d05fd6f23..f2f6106fd5e 100644 --- a/bigquery/api/async_query_test.py +++ b/bigquery/api/async_query_test.py @@ -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, diff --git a/bigquery/api/sync_query.py b/bigquery/api/sync_query.py index 089947d2369..1211f149339 100755 --- a/bigquery/api/sync_query.py +++ b/bigquery/api/sync_query.py @@ -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, diff --git a/bigquery/api/sync_query_test.py b/bigquery/api/sync_query_test.py index edf984c1338..98189793795 100644 --- a/bigquery/api/sync_query_test.py +++ b/bigquery/api/sync_query_test.py @@ -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,