8000 Merge remote-tracking branch 'upstream/main' into bug/join/name · pandas-dev/pandas@c0a7cac · GitHub
[go: up one dir, main page]

Skip to content

Commit c0a7cac

Browse files
committed
Merge remote-tracking branch 'upstream/main' into bug/join/name
2 parents 2a880bd + 4d0068e commit c0a7cac

File tree

244 files changed

+4918
-6942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

244 files changed

+4918
-6942
lines changed

.github/actions/run-tests/action.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ runs:
2020
path: test-data.xml
2121
if: failure()
2222

23-
- name: Report Coverage
24-
run: coverage report -m
25-
shell: bash -el {0}
26-
if: failure()
27-
2823
- name: Upload coverage to Codecov
2924
uses: codecov/codecov-action@v3
3025
with:

.pre-commit-config.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pylint, pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.1.6
22+
rev: v0.1.13
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -31,8 +31,7 @@ repos:
3131
exclude: ^pandas/tests
3232
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix]
3333
- id: ruff-format
34-
# TODO: "." not needed in ruff 0.1.8
35-
args: ["."]
34+
exclude: ^scripts
3635
- repo: https://github.com/jendrikseipp/vulture
3736
rev: 'v2.10'
3837
hooks:
@@ -299,11 +298,6 @@ repos:
299298
files: ^pandas/core/
300299
exclude: ^pandas/core/api\.py$
301300
types: [python]
302-
- id: no-bool-in-core-generic
303-
name: Use bool_t instead of bool in pandas/core/generic.py
304-
entry: python scripts/no_bool_in_generic.py
305-
language: python
306-
files: ^pandas/core/generic\.py$
307301
- id: no-return-exception
308302
name: Use raise instead of return for exceptions
309303
language: pygrep

asv_bench/benchmarks/index_object.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@ def setup(self):
136136
self.int_idxs.append(i_idx)
137137
o_idx = i_idx.astype(str)
138138
self.object_idxs.append(o_idx)
139+
self.same_range_idx = [self.range_idx] * N
139140

140141
def time_append_range_list(self):
141142
self.range_idx.append(self.range_idxs)
142143

144+
def time_append_range_list_same(self):
145+
self.range_idx.append(self.same_range_idx)
146+
143147
def time_append_int_list(self):
144148
self.int_idx.append(self.int_idxs)
145149

asv_bench/benchmarks/io/hdf.py

Lines changed: 3 additions & 3 deletions
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

asv_bench/benchmarks/strftime.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@ def time_frame_period_formatting_default(self, nobs, freq):
7979
def time_frame_period_formatting_default_explicit(self, nobs, freq):
8080
self.data["p"].dt.strftime(date_format=self.default_fmt)
8181

82-
def time_frame_period_formatting_index_default(self, nobs, freq):
83-
self.data.index.format()
84-
85-
def time_frame_period_formatting_index_default_explicit(self, nobs, freq):
86-
self.data.index.format(self.default_fmt)
87-
8882
def time_frame_period_formatting_custom(self, nobs, freq):
8983
self.data["p"].dt.strftime(date_format="%Y-%m-%d --- %H:%M:%S")
9084

ci/code_checks.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8787
pandas.Series.cat.remove_categories\
8888
pandas.Series.cat.set_categories\
8989
pandas.Series.plot\
90-
pandas.Series.plot.bar\
91-
pandas.Series.plot.barh\
92-
pandas.Series.plot.line\
93-
pandas.Series.plot.pie\
9490
pandas.DataFrame.plot\
95-
pandas.DataFrame.plot.bar\
96-
pandas.DataFrame.plot.barh\
97-
pandas.DataFrame.plot.line\
98-
pandas.DataFrame.plot.pie\
9991
pandas.tseries.offsets.DateOffset\
10092
pandas.tseries.offsets.BusinessDay\
10193
pandas.tseries.offsets.BDay\
@@ -144,14 +136,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
144136
pandas.Timedelta.resolution\
145137
pandas.Interval\
146138
pandas.Grouper\
147-
pandas.core.groupby.SeriesGroupBy.apply\
148139
pandas.core.groupby.DataFrameGroupBy.nth\
149140
pandas.core.groupby.DataFrameGroupBy.rolling\
150141
pandas.core.groupby.SeriesGroupBy.nth\
151142
pandas.core.groupby.SeriesGroupBy.rolling\
152-
pandas.core.groupby.DataFrameGroupBy.hist\
153143
pandas.core.groupby.DataFrameGroupBy.plot\
154-
pandas.core.groupby.DataFrameGroupBy.corrwith\
155144
pandas.core.groupby.SeriesGroupBy.plot # There should be no backslash in the final line, please keep this comment in the last ignored function
156145
RET=$(($RET + $?)) ; echo $MSG "DONE"
157146

doc/make.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _run_os(*args) -> None:
113113
114114
Examples
115115
--------
116-
>>> DocBuilder()._run_os('python', '--version')
116+
>>> DocBuilder()._run_os("python", "--version")
117117
"""
118118
subprocess.check_call(args, stdout=sys.stdout, stderr=sys.stderr)
119119

@@ -129,7 +129,7 @@ def _sphinx_build(self, kind: str):
129129
130130
Examples
131131
--------
132-
>>> DocBuilder(num_jobs=4)._sphinx_build('html')
132+
>>> DocBuilder(num_jobs=4)._sphinx_build("html")
133133
"""
134134
if kind not in ("html", "latex", "linkcheck"):
135135
raise ValueError(f"kind must be html, latex or linkcheck, not {kind}")

doc/redirects.csv

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ generated/pandas.api.types.is_int64_dtype,../reference/api/pandas.api.types.is_i
118118
generated/pandas.api.types.is_integer_dtype,../reference/api/pandas.api.types.is_integer_dtype
119119
generated/pandas.api.types.is_integer,../reference/api/pandas.api.types.is_integer
120120
generated/pandas.api.types.is_interval_dtype,../reference/api/pandas.api.types.is_interval_dtype
121-
generated/pandas.api.types.is_interval,../reference/api/pandas.api.types.is_interval
122121
generated/pandas.api.types.is_iterator,../reference/api/pandas.api.types.is_iterator
123122
generated/pandas.api.types.is_list_like,../reference/api/pandas.api.types.is_list_like
124123
generated/pandas.api.types.is_named_tuple,../reference/api/pandas.api.types.is_named_tuple
@@ -325,7 +324,6 @@ generated/pandas.DataFrame.axes,../reference/api/pandas.DataFrame.axes
325324
generated/pandas.DataFrame.between_time,../reference/api/pandas.DataFrame.between_time
326325
generated/pandas.DataFrame.bfill,../reference/api/pandas.DataFrame.bfill
327326
generated/pandas.DataFrame.blocks,../reference/api/pandas.DataFrame.blocks
328-
generated/pandas.DataFrame.bool,../reference/api/pandas.DataFrame.bool
329327
generated/pandas.DataFrame.boxplot,../reference/api/pandas.DataFrame.boxplot
330328
generated/pandas.DataFrame.clip,../reference/api/pandas.DataFrame.clip
331329
generated/pandas.DataFrame.clip_lower,../reference/api/pandas.DataFrame.clip_lower
@@ -495,7 +493,6 @@ generated/pandas.DataFrame.to_csv,../reference/api/pandas.DataFrame.to_csv
495493
generated/pandas.DataFrame.to_dict,../reference/api/pandas.DataFrame.to_dict
496494
generated/pandas.DataFrame.to_excel,../reference/api/pandas.DataFrame.to_excel
497495
generated/pandas.DataFrame.to_feather,../reference/api/pandas.DataFrame.to_feather
498-
generated/pandas.DataFrame.to_gbq,../reference/api/pandas.DataFrame.to_gbq
499496
generated/pandas.DataFrame.to_hdf,../reference/api/pandas.DataFrame.to_hdf
500497
generated/pandas.DataFrame.to,../reference/api/pandas.DataFrame.to
501498
generated/pandas.DataFrame.to_json,../reference/api/pandas.DataFrame.to_json
@@ -890,7 +887,6 @@ generated/pandas.read_csv,../reference/api/pandas.read_csv
890887
generated/pandas.read_excel,../reference/api/pandas.read_excel
891888
generated/pandas.read_feather,../reference/api/pandas.read_feather
892889
generated/pandas.read_fwf,../reference/api/pandas.read_fwf
893-
generated/pandas.read_gbq,../reference/api/pandas.read_gbq
894890
generated/pandas.read_hdf,../reference/api/pandas.read_hdf
895891
generated/pandas.read,../reference/api/pandas.read
896892
generated/pandas.read_json,../reference/api/pandas.read_json
@@ -932,7 +928,6 @@ generated/pandas.Series.between,../reference/api/pandas.Series.between
932928
generated/pandas.Series.between_time,../reference/api/pandas.Series.between_time
933929
generated/pandas.Series.bfill,../reference/api/pandas.Series.bfill
934930
generated/pandas.Series.blocks,../reference/api/pandas.Series.blocks
935-
generated/pandas.Series.bool,../reference/api/pandas.Series.bool
936931
generated/pandas.Series.cat.add_categories,../reference/api/pandas.Series.cat.add_categories
937932
generated/pandas.Series.cat.as_ordered,../reference/api/pandas.Series.cat.as_ordered
938933
generated/pandas.Series.cat.as_unordered,../reference/api/pandas.Series.cat.as_unordered
@@ -1116,7 +1111,6 @@ generated/pandas.Series.ptp,../reference/api/pandas.Series.ptp
11161111
generated/pandas.Series.quantile,../reference/api/pandas.Series.quantile
11171112
generated/pandas.Series.radd,../reference/api/pandas.Series.radd
11181113
generated/pandas.Series.rank,../reference/api/pandas.Series.rank
1119-
generated/pandas.Series.ravel,../reference/api/pandas.Series.ravel
11201114
generated/pandas.Series.rdiv,../reference/api/pandas.Series.rdiv
11211115
generated/pandas.Series.rdivmod,../reference/api/pandas.Series.rdivmod
11221116
generated/pandas.Series.real,../reference/api/pandas.Series.real
@@ -1251,7 +1245,6 @@ generated/pandas.Series.valid,../reference/api/pandas.Series.valid
12511245
generated/pandas.Series.value_counts,../reference/api/pandas.Series.value_counts
12521246
generated/pandas.Series.values,../reference/api/pandas.Series.values
12531247
generated/pandas.Series.var,../reference/api/pandas.Series.var
1254-
generated/pandas.Series.view,../reference/api/pandas.Series.view
12551248
generated/pandas.Series.where,../reference/api/pandas.Series.where
12561249
generated/pandas.Series.xs,../reference/api/pandas.Series.xs
12571250
generated/pandas.set_option,../reference/api/pandas.set_option

doc/source/conf.py

Lines changed: 0 additions & 4 deletions
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

Lines changed: 0 additions & 1 deletion
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/arrays.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ Scalar introspection
700700
api.types.is_float
701701
api.types.is_hashable
702702
api.types.is_integer
703-
api.types.is_interval
704703
api.types.is_number
705704
api.types.is_re
706705
api.types.is_re_compilable

doc/source/reference/frame.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ Conversion
4848
DataFrame.convert_dtypes
4949
DataFrame.infer_objects
5050
DataFrame.copy
51-
DataFrame.bool
5251
DataFrame.to_numpy
5352

5453
Indexing, iteration
@@ -381,7 +380,6 @@ Serialization / IO / conversion
381380
DataFrame.to_feather
382381
DataFrame.to_latex
383382
DataFrame.to_stata
384-
DataFrame.to_gbq
385383
DataFrame.to_records
386384
DataFrame.to_string
387385
DataFrame.to_clipboard

doc/source/reference/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ to be stable.
6262
..
6363
.. toctree::
6464
65-
api/pandas.Index.holds_integer
6665
api/pandas.Index.nlevels
6766
api/pandas.Index.sort
6867

doc/source/reference/indexing.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ Modifying and computations
6161
Index.identical
6262
Index.insert
6363
Index.is_
64-
Index.is_boolean
65-
Index.is_categorical
66-
Index.is_floating
67-
Index.is_integer
68-
Index.is_interval
69-
Index.is_numeric
70-
Index.is_object
7164
Index.min
7265
Index.max
7366
Index.reindex

doc/source/reference/io.rst

Lines changed: 0 additions & 7 deletions
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/reference/series.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Conversion
4747
Series.convert_dtypes
4848
Series.infer_objects
4949
Series.copy
50-
Series.bool
5150
Series.to_numpy
5251
Series.to_period
5352
Series.to_timestamp
@@ -236,10 +235,8 @@ Reshaping, sorting
236235
Series.unstack
237236
Series.explode
238237
Series.searchsorted
239-
Series.ravel
240238
Series.repeat
241239
Series.squeeze
242-
Series.view
243240

244241
Combining / comparing / joining / merging
245242
-----------------------------------------

doc/source/user_guide/basics.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,7 @@ Boolean reductions
299299
~~~~~~~~~~~~~~~~~~
300300

301301
You can apply the reductions: :attr:`~DataFrame.empty`, :meth:`~DataFrame.any`,
302-
:meth:`~DataFrame.all`, and :meth:`~DataFrame.bool` to provide a
303-
way to summarize a boolean result.
302+
:meth:`~DataFrame.all`.
304303

305304
.. ipython:: python
306305

doc/source/user_guide/copy_on_write.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ This array is read-only, which means that it can't be modified inplace:
295295
296296
The same holds true for a Series, since a Series always consists of a single array.
297297

298-
There are two potential solution to this:
298+
There are two potential solutions to this:
299299

300300
- Trigger a copy manually if you want to avoid updating DataFrames that share memory with your array.
301301
- Make the array writeable. This is a more performant solution but circumvents Copy-on-Write rules, so

doc/source/user_guide/groupby.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,6 @@ We could naturally group by either the ``A`` or ``B`` columns, or both:
137137

138138
``df.groupby('A')`` is just syntactic sugar for ``df.groupby(df['A'])``.
139139

140-
If we also have a MultiIndex on columns ``A`` and ``B``, we can group by all
141-
the columns except the one we specify:
142-
143-
.. ipython:: python
144-
145-
df2 = df.set_index(["A", "B"])
146-
grouped = df2.groupby(level=df2.index.names.difference(["B"]))
147-
grouped.sum()
148-
149140
The above GroupBy will split the DataFrame on its index (rows). To split by columns, first do
150141
a transpose:
151142

doc/source/user_guide/io.rst

Lines changed: 0 additions & 5 deletions
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/user_guide/missing_data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ is that the original data type will be coerced to ``np.float64`` or ``object``.
2121
pd.Series([True, False], dtype=np.bool_).reindex([0, 1, 2])
2222
2323
:class:`NaT` for NumPy ``np.datetime64``, ``np.timedelta64``, and :class:`PeriodDtype`. For typing applications,
24-
use :class:`api.types.NaTType`.
24+
use :class:`api.typing.NaTType`.
2525

2626
.. ipython:: python
2727

0 commit comments

Comments
 (0)
0