Skip to content

Commit

Permalink
DEPR: remove deprecated verbose, private_key kwargs for gbq (pandas-d…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored and proost committed Dec 19, 2019
1 parent 5883f33 commit 78f7ef9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 57 deletions.
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
- :meth:`Series.plot` no longer accepts positional arguments, pass keyword arguments instead (:issue:`30003`)
- :meth:`DataFrame.hist` and :meth:`Series.hist` no longer allows ``figsize="default"``, specify figure size by passinig a tuple instead (:issue:`30003`)
- Floordiv of integer-dtyped array by :class:`Timedelta` now raises ``TypeError`` (:issue:`21036`)
- :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`)
- :func:`pandas.api.types.infer_dtype` argument ``skipna`` defaults to ``True`` instead of ``False`` (:issue:`24050`)
- Removed the previously deprecated :attr:`Series.ix` and :attr:`DataFrame.ix` (:issue:`26438`)
- Removed the previously deprecated :meth:`Index.summary` (:issue:`18217`)
Expand Down Expand Up @@ -634,6 +635,7 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
- Removed the previously deprecated keyword "data" from :func:`andrews_curves`, use "frame" instead (:issue:`6956`)
- Removed the previously deprecated keyword "data" from :func:`parallel_coordinates`, use "frame" instead (:issue:`6956`)
- Removed the previously deprecated keyword "colors" from :func:`parallel_coordinates`, use "color" instead (:issue:`6956`)
- Removed the previously deprecated keywords "verbose" and "private_key" from :func:`read_gbq` (:issue:`30200`)
-

.. _whatsnew_1000.performance:
Expand Down
19 changes: 0 additions & 19 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1433,8 +1433,6 @@ def to_gbq(
location=None,
progress_bar=True,
credentials=None,
verbose=None,
private_key=None,
):
"""
Write a DataFrame to a Google BigQuery table.
Expand Down Expand Up @@ -1509,21 +1507,6 @@ def to_gbq(
*New in version 0.8.0 of pandas-gbq*.
.. versionadded:: 0.24.0
verbose : bool, deprecated
Deprecated in pandas-gbq version 0.4.0. Use the `logging module
to adjust verbosity instead
<https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
private_key : str, deprecated
Deprecated in pandas-gbq version 0.8.0. Use the ``credentials``
parameter and
:func:`google.oauth2.service_account.Credentials.from_service_account_info`
or
:func:`google.oauth2.service_account.Credentials.from_service_account_file`
instead.
Service account private key in JSON format. Can be file path
or string contents. This is useful for remote server
authentication (eg. Jupyter/IPython notebook on remote host).
See Also
--------
Expand All @@ -1544,8 +1527,6 @@ def to_gbq(
location=location,
progress_bar=progress_bar,
credentials=credentials,
verbose=verbose,
private_key=private_key,
)

@classmethod
Expand Down
23 changes: 0 additions & 23 deletions pandas/io/gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,21 +120,6 @@ def read_gbq(
``fastavro`` packages.
.. versionadded:: 0.25.0
private_key : str, deprecated
Deprecated in pandas-gbq version 0.8.0. Use the ``credentials``
parameter and
:func:`google.oauth2.service_account.Credentials.from_service_account_info`
or
:func:`google.oauth2.service_account.Credentials.from_service_account_file`
instead.
Service account private key in JSON format. Can be file path
or string contents. This is useful for remote server
authentication (eg. Jupyter/IPython notebook on remote host).
verbose : None, deprecated
Deprecated in pandas-gbq version 0.4.0. Use the `logging module to
adjust verbosity instead
<https://pandas-gbq.readthedocs.io/en/latest/intro.html#logging>`__.
progress_bar_type : Optional, str
If set, use the `tqdm <https://tqdm.github.io/>`__ library to
display a progress bar while the data downloads. Install the
Expand Down Expand Up @@ -182,14 +167,6 @@ def read_gbq(
kwargs["progress_bar_type"] = progress_bar_type
# END: new kwargs

# START: deprecated kwargs. Don't populate unless explicitly set.
if verbose is not None:
kwargs["verbose"] = verbose

if private_key is not None:
kwargs["private_key"] = private_key
# END: deprecated kwargs

return pandas_gbq.read_gbq(
query,
project_id=project_id,
Expand Down
15 changes: 0 additions & 15 deletions pandas/tests/io/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,6 @@ def make_mixed_dataframe_v2(test_size):
)


def test_read_gbq_with_deprecated_kwargs(monkeypatch):
captured_kwargs = {}

def mock_read_gbq(sql, **kwargs):
captured_kwargs.update(kwargs)
return DataFrame([[1.0]])

monkeypatch.setattr("pandas_gbq.read_gbq", mock_read_gbq)
private_key = object()
pd.read_gbq("SELECT 1", verbose=True, private_key=private_key)

assert captured_kwargs["verbose"]
assert captured_kwargs["private_key"] is private_key


def test_read_gbq_without_deprecated_kwargs(monkeypatch):
captured_kwargs = {}

Expand Down

0 comments on commit 78f7ef9

Please sign in to comment.