Skip to content

CLN: Warn that default dialect is changing to "standard" #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
sudo: false

language: python

matrix:
include:
- os: linux
python: 2.7
env: PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='true'
- os: linux
python: 3.5
env: PYTHON=3.5 PANDAS=0.18.1 COVERAGE='true' LINT='false'
- os: linux
python: 3.6
env: PYTHON=3.6 PANDAS=0.20.1 COVERAGE='false' LINT='false'
- os: linux
python: 3.6
env: PYTHON=3.6 PANDAS=MASTER COVERAGE='false' LINT='true'
env:
- PYTHON=2.7 PANDAS=0.19.2 COVERAGE='false' LINT='true' PYENV_VERSION=2.7.14
- PYTHON=3.5 PANDAS=0.18.1 COVERAGE='true' LINT='false' PYENV_VERSION=3.5.4
- PYTHON=3.6 PANDAS=0.20.1 COVERAGE='false' LINT='false' PYENV_VERSION=3.6.1
- PYTHON=3.6 PANDAS=MASTER COVERAGE='false' LINT='true' PYENV_VERSION=3.6.1

before_install:
- echo "before_install"
- source ci/travis_process_gbq_encryption.sh

install:
# work around https://github.com/travis-ci/travis-ci/issues/8363
# https://github.com/pre-commit/pre-commit/commit/e3ab8902692e896da9ded42bd4d76ea4e1de359d
- pyenv install -s $PYENV_VERSION
- pyenv global system $PYENV_VERSION
# Upgrade setuptools and pip to work around
# https://github.com/pypa/setuptools/issues/885
- pip install --upgrade setuptools
Expand Down
7 changes: 5 additions & 2 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
Changelog
=========

.. _changelog-0.5.1:
.. _changelog-0.6.0:

0.5.1 / (Unreleased)
0.6.0 / 2018-08-15
--------------------

- Warn when ``dialect`` is not passed in to ``read_gbq``. The default dialect
will be changing from 'legacy' to 'standard' in a future version.
(:issue:`195`)
- Use general float with 15 decimal digit precision when writing to local
CSV buffer in ``to_gbq``. This prevents numerical overflow in certain
edge cases. (:issue:`192`)
Expand Down
13 changes: 11 additions & 2 deletions pandas_gbq/gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def _parse_data(schema, rows):

def read_gbq(query, project_id=None, index_col=None, col_order=None,
reauth=False, private_key=None, auth_local_webserver=False,
dialect='legacy', location=None, configuration=None,
dialect=None, location=None, configuration=None,
verbose=None):
r"""Load data from Google BigQuery using google-cloud-python

Expand Down Expand Up @@ -515,6 +515,8 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,

.. versionadded:: 0.2.0
dialect : str, default 'legacy'
Note: The default value is changing to 'standard' in a future verion.

SQL syntax dialect to use. Value can be one of:

``'legacy'``
Expand Down Expand Up @@ -552,14 +554,21 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
df: DataFrame
DataFrame representing results of query.
"""
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" to disable this '
'warning.',
FutureWarning, stacklevel=2)

_test_google_api_imports()

if verbose is not None and SHOW_VERBOSE_DEPRECATION:
warnings.warn(
"verbose is deprecated and will be removed in "
"a future version. Set logging level in order to vary "
"verbosity", FutureWarning, stacklevel=1)
"verbosity", FutureWarning, stacklevel=2)

if dialect not in ('legacy', 'standard'):
raise ValueError("'{0}' is not valid for dialect".format(dialect))
Expand Down
Loading