Skip to content

Commit fa9ada7

Browse files
jbrockmendelWillAyd
authored andcommitted
DEPR: remove deprecated verbose, private_key kwargs for gbq (#30200)
1 parent c3c85c1 commit fa9ada7

File tree

4 files changed

+2
-57
lines changed

4 files changed

+2
-57
lines changed

doc/source/whatsnew/v1.0.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
535535
- :meth:`Series.plot` no longer accepts positional arguments, pass keyword arguments instead (:issue:`30003`)
536536
- :meth:`DataFrame.hist` and :meth:`Series.hist` no longer allows ``figsize="default"``, specify figure size by passinig a tuple instead (:issue:`30003`)
537537
- Floordiv of integer-dtyped array by :class:`Timedelta` now raises ``TypeError`` (:issue:`21036`)
538+
- :class:`TimedeltaIndex` and :class:`DatetimeIndex` no longer accept non-nanosecond dtype strings like "timedelta64" or "datetime64", use "timedelta64[ns]" and "datetime64[ns]" instead (:issue:`24806`)
538539
- :func:`pandas.api.types.infer_dtype` argument ``skipna`` defaults to ``True`` instead of ``False`` (:issue:`24050`)
539540
- Removed the previously deprecated :attr:`Series.ix` and :attr:`DataFrame.ix` (:issue:`26438`)
540541
- Removed the previously deprecated :meth:`Index.summary` (:issue:`18217`)
@@ -634,6 +635,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
634635
- Removed the previously deprecated keyword "data" from :func:`andrews_curves`, use "frame" instead (:issue:`6956`)
635636
- Removed the previously deprecated keyword "data" from :func:`parallel_coordinates`, use "frame" instead (:issue:`6956`)
636637
- Removed the previously deprecated keyword "colors" from :func:`parallel_coordinates`, use "color" instead (:issue:`6956`)
638+
- Removed the previously deprecated keywords "verbose" and "private_key" from :func:`read_gbq` (:issue:`30200`)
637639
-
638640

639641
.. _whatsnew_1000.performance:

pandas/core/frame.py

-19
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,6 @@ def to_gbq(
14331433
location=None,
14341434
progress_bar=True,
14351435
credentials=None,
1436-
verbose=None,
1437-
private_key=None,
14381436
):
14391437
"""
14401438
Write a DataFrame to a Google BigQuery table.
@@ -1509,21 +1507,6 @@ def to_gbq(
15091507
*New in version 0.8.0 of pandas-gbq*.
15101508
15111509
.. versionadded:: 0.24.0
1512-
verbose : bool, deprecated
1513-
Deprecated in pandas-gbq version 0.4.0. Use the `logging module
1514-
to adjust verbosity instead
1515-
<https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
1516-
private_key : str, deprecated
1517-
Deprecated in pandas-gbq version 0.8.0. Use the ``credentials``
1518-
parameter and
1519-
:func:`google.oauth2.service_account.Credentials.from_service_account_info`
1520-
or
1521-
:func:`google.oauth2.service_account.Credentials.from_service_account_file`
1522-
instead.
1523-
1524-
Service account private key in JSON format. Can be file path
1525-
or string contents. This is useful for remote server
1526-
authentication (eg. Jupyter/IPython notebook on remote host).
15271510
15281511
See Also
15291512
--------
@@ -1544,8 +1527,6 @@ def to_gbq(
15441527
location=location,
15451528
progress_bar=progress_bar,
15461529
credentials=credentials,
1547-
verbose=verbose,
1548-
private_key=private_key,
15491530
)
15501531

15511532
@classmethod

pandas/io/gbq.py

-23
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,6 @@ def read_gbq(
120120
``fastavro`` packages.
121121
122122
.. versionadded:: 0.25.0
123-
private_key : str, deprecated
124-
Deprecated in pandas-gbq version 0.8.0. Use the ``credentials``
125-
parameter and
126-
:func:`google.oauth2.service_account.Credentials.from_service_account_info`
127-
or
128-
:func:`google.oauth2.service_account.Credentials.from_service_account_file`
129-
instead.
130-
131-
Service account private key in JSON format. Can be file path
132-
or string contents. This is useful for remote server
133-
authentication (eg. Jupyter/IPython notebook on remote host).
134-
verbose : None, deprecated
135-
Deprecated in pandas-gbq version 0.4.0. Use the `logging module to
136-
adjust verbosity instead
137-
<https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
138123
progress_bar_type : Optional, str
139124
If set, use the `tqdm <https://tqdm.github.io/>`__ library to
140125
display a progress bar while the data downloads. Install the
@@ -182,14 +167,6 @@ def read_gbq(
182167
kwargs["progress_bar_type"] = progress_bar_type
183168
# END: new kwargs
184169

185-
# START: deprecated kwargs. Don't populate unless explicitly set.
186-
if verbose is not None:
187-
kwargs["verbose"] = verbose
188-
189-
if private_key is not None:
190-
kwargs["private_key"] = private_key
191-
# END: deprecated kwargs
192-
193170
return pandas_gbq.read_gbq(
194171
query,
195172
project_id=project_id,

pandas/tests/io/test_gbq.py

-15
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ def make_mixed_dataframe_v2(test_size):
8989
)
9090

9191

92-
def test_read_gbq_with_deprecated_kwargs(monkeypatch):
93-
captured_kwargs = {}
94-
95-
def mock_read_gbq(sql, **kwargs):
96-
captured_kwargs.update(kwargs)
97-
return DataFrame([[1.0]])
98-
99-
monkeypatch.setattr("pandas_gbq.read_gbq", mock_read_gbq)
100-
private_key = object()
101-
pd.read_gbq("SELECT 1", verbose=True, private_key=private_key)
102-
103-
assert captured_kwargs["verbose"]
104-
assert captured_kwargs["private_key"] is private_key
105-
106-
10792
def test_read_gbq_without_deprecated_kwargs(monkeypatch):
10893
captured_kwargs = {}
10994

0 commit comments

Comments
 (0)