Skip to content

Commit 06ec9a4

Browse files
authored
CLN: Make first argument in IO writers keyword only; remove gbq (#57279)
1 parent 7fe86b6 commit 06ec9a4

32 files changed

+33
-664
lines changed

asv_bench/benchmarks/io/hdf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ def setup(self, format):
123123
index=date_range("20000101", periods=N, freq="h"),
124124
)
125125
self.df["object"] = Index([f"i-{i}" for i in range(N)], dtype=object)
126-
self.df.to_hdf(self.fname, "df", format=format)
126+
self.df.to_hdf(self.fname, key="df", format=format)
127127

128128
# Numeric df
129129
self.df1 = self.df.copy()
130130
self.df1 = self.df1.reset_index()
131-
self.df1.to_hdf(self.fname, "df1", format=format)
131+
self.df1.to_hdf(self.fname, key="df1", format=format)
132132

133133
def time_read_hdf(self, format):
134134
read_hdf(self.fname, "df")
@@ -137,7 +137,7 @@ def peakmem_read_hdf(self, format):
137137
read_hdf(self.fname, "df")
138138

139139
def time_write_hdf(self, format):
140-
self.df.to_hdf(self.fname, "df", format=format)
140+
self.df.to_hdf(self.fname, key="df", format=format)
141141

142142

143143
from ..pandas_vb_common import setup # noqa: F401 isort:skip

doc/redirects.csv

-2
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,6 @@ generated/pandas.DataFrame.to_csv,../reference/api/pandas.DataFrame.to_csv
495495
generated/pandas.DataFrame.to_dict,../reference/api/pandas.DataFrame.to_dict
496496
generated/pandas.DataFrame.to_excel,../reference/api/pandas.DataFrame.to_excel
497497
generated/pandas.DataFrame.to_feather,../reference/api/pandas.DataFrame.to_feather
498-
generated/pandas.DataFrame.to_gbq,../reference/api/pandas.DataFrame.to_gbq
499498
generated/pandas.DataFrame.to_hdf,../reference/api/pandas.DataFrame.to_hdf
500499
generated/pandas.DataFrame.to,../reference/api/pandas.DataFrame.to
501500
generated/pandas.DataFrame.to_json,../reference/api/pandas.DataFrame.to_json
@@ -890,7 +889,6 @@ generated/pandas.read_csv,../reference/api/pandas.read_csv
890889
generated/pandas.read_excel,../reference/api/pandas.read_excel
891890
generated/pandas.read_feather,../reference/api/pandas.read_feather
892891
generated/pandas.read_fwf,../reference/api/pandas.read_fwf
893-
generated/pandas.read_gbq,../reference/api/pandas.read_gbq
894892
generated/pandas.read_hdf,../reference/api/pandas.read_hdf
895893
generated/pandas.read,../reference/api/pandas.read
896894
generated/pandas.read_json,../reference/api/pandas.read_json

doc/source/conf.py

-4
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@
323323
("pandas.io.clipboard.read_clipboard", "pandas.read_clipboard"),
324324
("pandas.io.excel.ExcelFile.parse", "pandas.ExcelFile.parse"),
325325
("pandas.io.excel.read_excel", "pandas.read_excel"),
326-
("pandas.io.gbq.read_gbq", "pandas.read_gbq"),
327326
("pandas.io.html.read_html", "pandas.read_html"),
328327
("pandas.io.json.read_json", "pandas.read_json"),
329328
("pandas.io.parsers.read_csv", "pandas.read_csv"),
@@ -812,8 +811,6 @@ def setup(app) -> None:
812811
for link in [
813812
"http://scatterci.github.io/pydata/pandas",
814813
"http://specs.frictionlessdata.io/json-table-schema/",
815-
"https://cloud.google.com/bigquery/docs/access-control#roles",
816-
"https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.query",
817814
"https://crates.io/crates/calamine",
818815
"https://devguide.python.org/setup/#macos",
819816
"https://en.wikipedia.org/wiki/Imputation_statistics",
@@ -829,7 +826,6 @@ def setup(app) -> None:
829826
"https://nipunbatra.github.io/blog/visualisation/2013/05/01/aggregation-timeseries.html",
830827
"https://nbviewer.ipython.org/gist/metakermit/5720498",
831828
"https://numpy.org/doc/stable/user/basics.byteswapping.html",
832-
"https://pandas-gbq.readthedocs.io/en/latest/changelog.html#changelog-0-8-0",
833829
"https://pandas.pydata.org/pandas-docs/stable/io.html#io-chunking",
834830
"https://pandas.pydata.org/pandas-docs/stable/ecosystem.html",
835831
"https://sqlalchemy.readthedocs.io/en/latest/dialects/index.html",

doc/source/getting_started/install.rst

-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ Dependency Minimum Version pip extra Notes
386386
fsspec 2022.11.0 fss, gcp, aws Handling files aside from simple local and HTTP (required
387387
dependency of s3fs, gcsfs).
388388
gcsfs 2022.11.0 gcp Google Cloud Storage access
389-
pandas-gbq 0.19.0 gcp Google Big Query access
390389
s3fs 2022.11.0 aws Amazon S3 access
391390
========================= ================== =============== =============================================================
392391

doc/source/reference/frame.rst

-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ Serialization / IO / conversion
381381
DataFrame.to_feather
382382
DataFrame.to_latex
383383
DataFrame.to_stata
384-
DataFrame.to_gbq
385384
DataFrame.to_records
386385
DataFrame.to_string
387386
DataFrame.to_clipboard

doc/source/reference/io.rst

-7
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,6 @@ SQL
188188
read_sql
189189
DataFrame.to_sql
190190

191-
Google BigQuery
192-
~~~~~~~~~~~~~~~
193-
.. autosummary::
194-
:toctree: api/
195-
196-
read_gbq
197-
198191
STATA
199192
~~~~~
200193
.. autosummary::

doc/source/user_guide/io.rst

-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like
3636
binary;`SPSS <https://en.wikipedia.org/wiki/SPSS>`__;:ref:`read_spss<io.spss_reader>`;
3737
binary;`Python Pickle Format <https://docs.python.org/3/library/pickle.html>`__;:ref:`read_pickle<io.pickle>`;:ref:`to_pickle<io.pickle>`
3838
SQL;`SQL <https://en.wikipedia.org/wiki/SQL>`__;:ref:`read_sql<io.sql>`;:ref:`to_sql<io.sql>`
39-
SQL;`Google BigQuery <https://en.wikipedia.org/wiki/BigQuery>`__;:ref:`read_gbq<io.bigquery>`;:ref:`to_gbq<io.bigquery>`
4039

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

@@ -6096,10 +6095,6 @@ Google BigQuery
60966095

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

6099-
pandas integrates with this external package. if ``pandas-gbq`` is installed, you can
6100-
use the pandas methods ``pd.read_gbq`` and ``DataFrame.to_gbq``, which will call the
6101-
respective functions from ``pandas-gbq``.
6102-
61036098
Full documentation can be found `here <https://pandas-gbq.readthedocs.io/en/latest/>`__.
61046099

61056100
.. _io.stata:

doc/source/whatsnew/v3.0.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,14 @@ Deprecations
102102

103103
Removal of prior version deprecations/changes
104104
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105+
- All arguments except the first ``path``-like argument in IO writers are now keyword only (:issue:`54229`)
105106
- Removed :meth:`DataFrame.first` and :meth:`DataFrame.last` (:issue:`53710`)
106107
- Removed :meth:`DataFrameGroupby.fillna` and :meth:`SeriesGroupBy.fillna` (:issue:`55719`)
107108
- Removed ``DataFrameGroupBy.grouper`` and ``SeriesGroupBy.grouper`` (:issue:`56521`)
108109
- 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`)
109110
- Removed ``axis`` argument from all groupby operations (:issue:`50405`)
110111
- Removed ``pandas.io.sql.execute`` (:issue:`50185`)
112+
- 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`)
111113
- Removed deprecated argument ``obj`` in :meth:`.DataFrameGroupBy.get_group` and :meth:`.SeriesGroupBy.get_group` (:issue:`53545`)
112114
- Removed the ``ArrayManager`` (:issue:`55043`)
113115
- Removed unused arguments ``*args`` and ``**kwargs`` in :class:`Resampler` methods (:issue:`50977`)

pandas/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@
162162
read_parquet,
163163
read_orc,
164164
read_feather,
165-
read_gbq,
166165
read_html,
167166
read_xml,
168167
read_json,
@@ -352,7 +351,6 @@
352351
"read_excel",
353352
"read_feather",
354353
"read_fwf",
355-
"read_gbq",
356354
"read_hdf",
357355
"read_html",
358356
"read_json",

pandas/_typing.py

-3
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,6 @@ def closed(self) -> bool:
510510
# from_dict
511511
FromDictOrient = Literal["columns", "index", "tight"]
512512

513-
# to_gbc
514-
ToGbqIfexist = Literal["fail", "replace", "append"]
515-
516513
# to_stata
517514
ToStataByteorder = Literal[">", "<", "little", "big"]
518515

pandas/compat/_optional.py

-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
"numexpr": "2.8.4",
3838
"odfpy": "1.4.1",
3939
"openpyxl": "3.1.0",
40-
"pandas_gbq": "0.19.0",
4140
"psycopg2": "2.9.6", # (dt dec pq3 ext lo64)
4241
"pymysql": "1.0.2",
4342
"pyarrow": "10.0.1",
@@ -68,7 +67,6 @@
6867
"jinja2": "Jinja2",
6968
"lxml.etree": "lxml",
7069
"odf": "odfpy",
71-
"pandas_gbq": "pandas-gbq",
7270
"python_calamine": "python-calamine",
7371
"sqlalchemy": "SQLAlchemy",
7472
"tables": "pytables",

0 commit comments

Comments
 (0)