Skip to content

Commit

Permalink
CLN: Make first argument in IO writers keyword only; remove gbq (#57279)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Feb 7, 2024
1 parent 7fe86b6 commit 06ec9a4
Show file tree
Hide file tree
Showing 32 changed files with 33 additions and 664 deletions.
6 changes: 3 additions & 3 deletions asv_bench/benchmarks/io/hdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ def setup(self, format):
index=date_range("20000101", periods=N, freq="h"),
)
self.df["object"] = Index([f"i-{i}" for i in range(N)], dtype=object)
self.df.to_hdf(self.fname, "df", format=format)
self.df.to_hdf(self.fname, key="df", format=format)

# Numeric df
self.df1 = self.df.copy()
self.df1 = self.df1.reset_index()
self.df1.to_hdf(self.fname, "df1", format=format)
self.df1.to_hdf(self.fname, key="df1", format=format)

def time_read_hdf(self, format):
read_hdf(self.fname, "df")
Expand All @@ -137,7 +137,7 @@ def peakmem_read_hdf(self, format):
read_hdf(self.fname, "df")

def time_write_hdf(self, format):
self.df.to_hdf(self.fname, "df", format=format)
self.df.to_hdf(self.fname, key="df", format=format)


from ..pandas_vb_common import setup # noqa: F401 isort:skip
2 changes: 0 additions & 2 deletions doc/redirects.csv
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ generated/pandas.DataFrame.to_csv,../reference/api/pandas.DataFrame.to_csv
generated/pandas.DataFrame.to_dict,../reference/api/pandas.DataFrame.to_dict
generated/pandas.DataFrame.to_excel,../reference/api/pandas.DataFrame.to_excel
generated/pandas.DataFrame.to_feather,../reference/api/pandas.DataFrame.to_feather
generated/pandas.DataFrame.to_gbq,../reference/api/pandas.DataFrame.to_gbq
generated/pandas.DataFrame.to_hdf,../reference/api/pandas.DataFrame.to_hdf
generated/pandas.DataFrame.to,../reference/api/pandas.DataFrame.to
generated/pandas.DataFrame.to_json,../reference/api/pandas.DataFrame.to_json
Expand Down Expand Up @@ -890,7 +889,6 @@ generated/pandas.read_csv,../reference/api/pandas.read_csv
generated/pandas.read_excel,../reference/api/pandas.read_excel
generated/pandas.read_feather,../reference/api/pandas.read_feather
generated/pandas.read_fwf,../reference/api/pandas.read_fwf
generated/pandas.read_gbq,../reference/api/pandas.read_gbq
generated/pandas.read_hdf,../reference/api/pandas.read_hdf
generated/pandas.read,../reference/api/pandas.read
generated/pandas.read_json,../reference/api/pandas.read_json
Expand Down
4 changes: 0 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@
("pandas.io.clipboard.read_clipboard", "pandas.read_clipboard"),
("pandas.io.excel.ExcelFile.parse", "pandas.ExcelFile.parse"),
("pandas.io.excel.read_excel", "pandas.read_excel"),
("pandas.io.gbq.read_gbq", "pandas.read_gbq"),
("pandas.io.html.read_html", "pandas.read_html"),
("pandas.io.json.read_json", "pandas.read_json"),
("pandas.io.parsers.read_csv", "pandas.read_csv"),
Expand Down Expand Up @@ -812,8 +811,6 @@ def setup(app) -> None:
for link in [
"http://scatterci.github.io/pydata/pandas",
"http://specs.frictionlessdata.io/json-table-schema/",
"https://cloud.google.com/bigquery/docs/access-control#roles",
"https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query",
"https://crates.io/crates/calamine",
"https://devguide.python.org/setup/#macos",
"https://en.wikipedia.org/wiki/Imputation_statistics",
Expand All @@ -829,7 +826,6 @@ def setup(app) -> None:
"https://nipunbatra.github.io/blog/visualisation/2013/05/01/aggregation-timeseries.html",
"https://nbviewer.ipython.org/gist/metakermit/5720498",
"https://numpy.org/doc/stable/user/basics.byteswapping.html",
"https://pandas-gbq.readthedocs.io/en/latest/changelog.html#changelog-0-8-0",
"https://pandas.pydata.org/pandas-docs/stable/io.html#io-chunking",
"https://pandas.pydata.org/pandas-docs/stable/ecosystem.html",
"https://sqlalchemy.readthedocs.io/en/latest/dialects/index.html",
Expand Down
1 change: 0 additions & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ Dependency Minimum Version pip extra Notes
fsspec 2022.11.0 fss, gcp, aws Handling files aside from simple local and HTTP (required
dependency of s3fs, gcsfs).
gcsfs 2022.11.0 gcp Google Cloud Storage access
pandas-gbq 0.19.0 gcp Google Big Query access
s3fs 2022.11.0 aws Amazon S3 access
========================= ================== =============== =============================================================

Expand Down
1 change: 0 additions & 1 deletion doc/source/reference/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ Serialization / IO / conversion
DataFrame.to_feather
DataFrame.to_latex
DataFrame.to_stata
DataFrame.to_gbq
DataFrame.to_records
DataFrame.to_string
DataFrame.to_clipboard
Expand Down
7 changes: 0 additions & 7 deletions doc/source/reference/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@ SQL
read_sql
DataFrame.to_sql

Google BigQuery
~~~~~~~~~~~~~~~
.. autosummary::
:toctree: api/

read_gbq

STATA
~~~~~
.. autosummary::
Expand Down
5 changes: 0 additions & 5 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like
binary;`SPSS <https://en.wikipedia.org/wiki/SPSS>`__;:ref:`read_spss<io.spss_reader>`;
binary;`Python Pickle Format <https://docs.python.org/3/library/pickle.html>`__;:ref:`read_pickle<io.pickle>`;:ref:`to_pickle<io.pickle>`
SQL;`SQL <https://en.wikipedia.org/wiki/SQL>`__;:ref:`read_sql<io.sql>`;:ref:`to_sql<io.sql>`
SQL;`Google BigQuery <https://en.wikipedia.org/wiki/BigQuery>`__;:ref:`read_gbq<io.bigquery>`;:ref:`to_gbq<io.bigquery>`

:ref:`Here <io.perf>` is an informal performance comparison for some of these IO methods.

Expand Down Expand Up @@ -6096,10 +6095,6 @@ Google BigQuery

The ``pandas-gbq`` package provides functionality to read/write from Google BigQuery.

pandas integrates with this external package. if ``pandas-gbq`` is installed, you can
use the pandas methods ``pd.read_gbq`` and ``DataFrame.to_gbq``, which will call the
respective functions from ``pandas-gbq``.

Full documentation can be found `here <https://pandas-gbq.readthedocs.io/en/latest/>`__.

.. _io.stata:
Expand Down
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ Deprecations

Removal of prior version deprecations/changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- All arguments except the first ``path``-like argument in IO writers are now keyword only (:issue:`54229`)
- Removed :meth:`DataFrame.first` and :meth:`DataFrame.last` (:issue:`53710`)
- Removed :meth:`DataFrameGroupby.fillna` and :meth:`SeriesGroupBy.fillna` (:issue:`55719`)
- Removed ``DataFrameGroupBy.grouper`` and ``SeriesGroupBy.grouper`` (:issue:`56521`)
- Removed ``axis`` argument from :meth:`DataFrame.groupby`, :meth:`Series.groupby`, :meth:`DataFrame.rolling`, :meth:`Series.rolling`, :meth:`DataFrame.resample`, and :meth:`Series.resample` (:issue:`51203`)
- Removed ``axis`` argument from all groupby operations (:issue:`50405`)
- Removed ``pandas.io.sql.execute`` (:issue:`50185`)
- Removed ``read_gbq`` and ``DataFrame.to_gbq``. Use ``pandas_gbq.read_gbq`` and ``pandas_gbq.to_gbq`` instead https://pandas-gbq.readthedocs.io/en/latest/api.html (:issue:`55525`)
- Removed deprecated argument ``obj`` in :meth:`.DataFrameGroupBy.get_group` and :meth:`.SeriesGroupBy.get_group` (:issue:`53545`)
- Removed the ``ArrayManager`` (:issue:`55043`)
- Removed unused arguments ``*args`` and ``**kwargs`` in :class:`Resampler` methods (:issue:`50977`)
Expand Down
2 changes: 0 additions & 2 deletions pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@
read_parquet,
read_orc,
read_feather,
read_gbq,
read_html,
read_xml,
read_json,
Expand Down Expand Up @@ -352,7 +351,6 @@
"read_excel",
"read_feather",
"read_fwf",
"read_gbq",
"read_hdf",
"read_html",
"read_json",
Expand Down
3 changes: 0 additions & 3 deletions pandas/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,6 @@ def closed(self) -> bool:
# from_dict
FromDictOrient = Literal["columns", "index", "tight"]

# to_gbc
ToGbqIfexist = Literal["fail", "replace", "append"]

# to_stata
ToStataByteorder = Literal[">", "<", "little", "big"]

Expand Down
2 changes: 0 additions & 2 deletions pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"numexpr": "2.8.4",
"odfpy": "1.4.1",
"openpyxl": "3.1.0",
"pandas_gbq": "0.19.0",
"psycopg2": "2.9.6", # (dt dec pq3 ext lo64)
"pymysql": "1.0.2",
"pyarrow": "10.0.1",
Expand Down Expand Up @@ -68,7 +67,6 @@
"jinja2": "Jinja2",
"lxml.etree": "lxml",
"odf": "odfpy",
"pandas_gbq": "pandas-gbq",
"python_calamine": "python-calamine",
"sqlalchemy": "SQLAlchemy",
"tables": "pytables",
Expand Down

0 comments on commit 06ec9a4

Please sign in to comment.