Skip to content

Commit 36381c5

Browse files
committed
[ENH] pull in warning for dialect change from pandas-gbq.
1 parent 0976e12 commit 36381c5

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

doc/source/whatsnew/v0.24.0.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ Other Enhancements
170170
- :meth:`Series.droplevel` and :meth:`DataFrame.droplevel` are now implemented (:issue:`20342`)
171171
- Added support for reading from Google Cloud Storage via the ``gcsfs`` library (:issue:`19454`)
172172
- :func:`to_gbq` and :func:`read_gbq` signature and documentation updated to
173-
reflect changes from the `Pandas-GBQ library version 0.5.0
174-
<https://pandas-gbq.readthedocs.io/en/latest/changelog.html#changelog-0-5-0>`__.
173+
reflect changes from the `Pandas-GBQ library version 0.6.0
174+
<https://pandas-gbq.readthedocs.io/en/latest/changelog.html#changelog-0-6-0>`__.
175175
(:issue:`21627`)
176176
- New method :meth:`HDFStore.walk` will recursively walk the group hierarchy of an HDF5 file (:issue:`10932`)
177177
- :func:`read_html` copies cell data across ``colspan`` and ``rowspan``, and it treats all-``th`` table rows as headers if ``header`` kwarg is not given and there is no ``thead`` (:issue:`17054`)

pandas/io/gbq.py

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
""" Google BigQuery support """
22

3+
import warnings
4+
35

46
def _try_import():
57
# since pandas is a dependency of pandas-gbq
@@ -23,7 +25,7 @@ def _try_import():
2325

2426
def read_gbq(query, project_id=None, index_col=None, col_order=None,
2527
reauth=False, private_key=None, auth_local_webserver=False,
26-
dialect='legacy', location=None, configuration=None,
28+
dialect=None, location=None, configuration=None,
2729
verbose=None):
2830
"""
2931
Load data from Google BigQuery.
@@ -65,6 +67,8 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
6567
6668
*New in version 0.2.0 of pandas-gbq*.
6769
dialect : str, default 'legacy'
70+
Note: The default value is changing to 'standard' in a future verion.
71+
6872
SQL syntax dialect to use. Value can be one of:
6973
7074
``'legacy'``
@@ -108,6 +112,17 @@ def read_gbq(query, project_id=None, index_col=None, col_order=None,
108112
pandas.DataFrame.to_gbq : Write a DataFrame to Google BigQuery.
109113
"""
110114
pandas_gbq = _try_import()
115+
116+
if dialect is None:
117+
dialect = "legacy"
118+
warnings.warn(
119+
'The default value for dialect is changing to "standard" in a '
120+
'future version of pandas-gbq. Pass in dialect="legacy" to '
121+
"disable this warning.",
122+
FutureWarning,
123+
stacklevel=2,
124+
)
125+
111126
return pandas_gbq.read_gbq(
112127
query, project_id=project_id, index_col=index_col,
113128
col_order=col_order, reauth=reauth, verbose=verbose,

0 commit comments

Comments
 (0)