Skip to content

Commit

Permalink
ENH: Use standard SQL as default. (#245)
Browse files Browse the repository at this point in the history
Removes the warning when a SQL dialect is unspecified.
  • Loading branch information
tswast committed Jan 25, 2019
1 parent b0254c4 commit ee07933
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 4 additions & 11 deletions pandas_gbq/gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def __init__(
reauth=False,
private_key=None,
auth_local_webserver=False,
dialect="legacy",
dialect="standard",
location=None,
credentials=None,
):
Expand Down Expand Up @@ -732,8 +732,8 @@ def read_gbq(
http://google-auth-oauthlib.readthedocs.io/en/latest/reference/google_auth_oauthlib.flow.html#google_auth_oauthlib.flow.InstalledAppFlow.run_console
.. versionadded:: 0.2.0
dialect : str, default 'legacy'
Note: The default value is changing to 'standard' in a future verion.
dialect : str, default 'standard'
Note: The default value changed to 'standard' in version 0.10.0.
SQL syntax dialect to use. Value can be one of:
Expand Down Expand Up @@ -796,14 +796,7 @@ def read_gbq(
dialect = context.dialect

if dialect is None:
dialect = "legacy"
warnings.warn(
'The default value for dialect is changing to "standard" in a '
'future version. Pass in dialect="legacy" or set '
'pandas_gbq.context.dialect="legacy" to disable this warning.',
FutureWarning,
stacklevel=2,
)
dialect = "standard"

_test_google_api_imports()

Expand Down
5 changes: 0 additions & 5 deletions tests/unit/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,6 @@ def test_read_gbq_with_invalid_dialect():
assert "is not valid for dialect" in str(excinfo.value)


def test_read_gbq_without_dialect_warns_future_change():
with pytest.warns(FutureWarning):
gbq.read_gbq("SELECT 1")


def test_generate_bq_schema_deprecated():
# 11121 Deprecation of generate_bq_schema
with pytest.warns(FutureWarning):
Expand Down

0 comments on commit ee07933

Please sign in to comment.