Skip to content

Commit 04a8169

Browse files
authored
Merge branch 'pandas-dev:main' into Wrong-error-message-in-HDFStore.append
2 parents 52ad0eb + e84a7f7 commit 04a8169

File tree

105 files changed

+641
-356
lines changed

Some content is hidden

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

105 files changed

+641
-356
lines changed

.github/workflows/unit-tests.yml

+13-19
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107

108108
services:
109109
mysql:
110-
image: mysql:8
110+
image: mysql:9
111111
env:
112112
MYSQL_ALLOW_EMPTY_PASSWORD: yes
113113
MYSQL_DATABASE: pandas
@@ -120,7 +120,7 @@ jobs:
120120
- 3306:3306
121121

122122
postgres:
123-
image: postgres:16
123+
image: postgres:17
124124
env:
125125
PGUSER: postgres
126126
POSTGRES_USER: postgres
@@ -135,7 +135,7 @@ jobs:
135135
- 5432:5432
136136

137137
moto:
138-
image: motoserver/moto:5.0.0
138+
image: motoserver/moto:5.0.27
139139
env:
140140
AWS_ACCESS_KEY_ID: foobar_key
141141
AWS_SECRET_ACCESS_KEY: foobar_secret
@@ -242,15 +242,14 @@ jobs:
242242
- name: Build environment and Run Tests
243243
# https://github.com/numpy/numpy/issues/24703#issuecomment-1722379388
244244
run: |
245-
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
245+
/opt/python/cp313-cp313/bin/python -m venv ~/virtualenvs/pandas-dev
246246
. ~/virtualenvs/pandas-dev/bin/activate
247247
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
248248
python -m pip install numpy -Csetup-args="-Dallow-noblas=true"
249249
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
250250
python -m pip install --no-cache-dir --no-build-isolation -e . -Csetup-args="--werror"
251251
python -m pip list --no-cache-dir
252-
export PANDAS_CI=1
253-
python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
252+
PANDAS_CI=1 python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
254253
concurrency:
255254
# https://github.community/t/concurrecy-not-work-for-push/183068/7
256255
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-32bit
@@ -259,7 +258,7 @@ jobs:
259258
Linux-Musl:
260259
runs-on: ubuntu-22.04
261260
container:
262-
image: quay.io/pypa/musllinux_1_1_x86_64
261+
image: quay.io/pypa/musllinux_1_2_x86_64
263262
steps:
264263
- name: Checkout pandas Repo
265264
# actions/checkout does not work since it requires node
@@ -281,7 +280,7 @@ jobs:
281280
apk add musl-locales
282281
- name: Build environment
283282
run: |
284-
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
283+
/opt/python/cp313-cp313/bin/python -m venv ~/virtualenvs/pandas-dev
285284
. ~/virtualenvs/pandas-dev/bin/activate
286285
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
287286
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
@@ -291,8 +290,7 @@ jobs:
291290
- name: Run Tests
292291
run: |
293292
. ~/virtualenvs/pandas-dev/bin/activate
294-
export PANDAS_CI=1
295-
python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
293+
PANDAS_CI=1 python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
296294
concurrency:
297295
# https://github.community/t/concurrecy-not-work-for-push/183068/7
298296
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-musl
@@ -357,8 +355,7 @@ jobs:
357355
python --version
358356
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
359357
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
360-
python -m pip install versioneer[toml]
361-
python -m pip install python-dateutil tzdata cython hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
358+
python -m pip install versioneer[toml] python-dateutil tzdata cython hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
362359
python -m pip install -ve . --no-build-isolation --no-index --no-deps -Csetup-args="--werror"
363360
python -m pip list
364361
@@ -375,7 +372,7 @@ jobs:
375372

376373
concurrency:
377374
# https://github.community/t/concurrecy-not-work-for-push/183068/7
378-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-python-freethreading-dev
375+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-python-freethreading-dev
379376
cancel-in-progress: true
380377

381378
env:
@@ -396,14 +393,11 @@ jobs:
396393
nogil: true
397394

398395
- name: Build Environment
399-
# TODO: Once numpy 2.2.1 is out, don't install nightly version
400-
# Tests segfault with numpy 2.2.0: https://github.com/numpy/numpy/pull/27955
401396
run: |
402397
python --version
403-
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
404-
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython numpy
405-
python -m pip install versioneer[toml]
406-
python -m pip install python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
398+
python -m pip install --upgrade pip setuptools wheel numpy meson[ninja]==1.2.1 meson-python==0.13.1
399+
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython
400+
python -m pip install versioneer[toml] python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
407401
python -m pip install -ve . --no-build-isolation --no-index --no-deps -Csetup-args="--werror"
408402
python -m pip list
409403

.pre-commit-config.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ci:
1919
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.8.6
22+
rev: v0.9.4
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -41,7 +41,7 @@ repos:
4141
pass_filenames: true
4242
require_serial: false
4343
- repo: https://github.com/codespell-project/codespell
44-
rev: v2.3.0
44+
rev: v2.4.1
4545
hooks:
4646
- id: codespell
4747
types_or: [python, rst, markdown, cython, c]
@@ -70,7 +70,7 @@ repos:
7070
- id: trailing-whitespace
7171
args: [--markdown-linebreak-ext=md]
7272
- repo: https://github.com/PyCQA/isort
73-
rev: 5.13.2
73+
rev: 6.0.0
7474
hooks:
7575
- id: isort
7676
- repo: https://github.com/asottile/pyupgrade
@@ -95,14 +95,14 @@ repos:
9595
- id: sphinx-lint
9696
args: ["--enable", "all", "--disable", "line-too-long"]
9797
- repo: https://github.com/pre-commit/mirrors-clang-format
98-
rev: v19.1.6
98+
rev: v19.1.7
9999
hooks:
100100
- id: clang-format
101101
files: ^pandas/_libs/src|^pandas/_libs/include
102102
args: [-i]
103103
types_or: [c, c++]
104104
- repo: https://github.com/trim21/pre-commit-mirror-meson
105-
rev: v1.6.1
105+
rev: v1.7.0
106106
hooks:
107107
- id: meson-fmt
108108
args: ['--inplace']

asv_bench/benchmarks/io/style.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Render:
1313
def setup(self, cols, rows):
1414
self.df = DataFrame(
1515
np.random.randn(rows, cols),
16-
columns=[f"float_{i+1}" for i in range(cols)],
17-
index=[f"row_{i+1}" for i in range(rows)],
16+
columns=[f"float_{i + 1}" for i in range(cols)],
17+
index=[f"row_{i + 1}" for i in range(rows)],
1818
)
1919

2020
def time_apply_render(self, cols, rows):

doc/make.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,7 @@ def latex(self, force=False):
260260
for i in range(3):
261261
self._run_os("pdflatex", "-interaction=nonstopmode", "pandas.tex")
262262
raise SystemExit(
263-
"You should check the file "
264-
'"build/latex/pandas.pdf" for problems.'
263+
'You should check the file "build/latex/pandas.pdf" for problems.'
265264
)
266265
self._run_os("make")
267266
return ret_code
@@ -343,8 +342,7 @@ def main():
343342
dest="verbosity",
344343
default=0,
345344
help=(
346-
"increase verbosity (can be repeated), "
347-
"passed to the sphinx build command"
345+
"increase verbosity (can be repeated), passed to the sphinx build command"
348346
),
349347
)
350348
argparser.add_argument(

doc/source/user_guide/style.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@
12881288
"outputs": [],
12891289
"source": [
12901290
"df2.loc[:4].style.highlight_max(\n",
1291-
" axis=1, props=(\"color:white; \" \"font-weight:bold; \" \"background-color:darkblue;\")\n",
1291+
" axis=1, props=(\"color:white; font-weight:bold; background-color:darkblue;\")\n",
12921292
")"
12931293
]
12941294
},

doc/source/whatsnew/v3.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ Other enhancements
5959
- :meth:`Series.cummin` and :meth:`Series.cummax` now supports :class:`CategoricalDtype` (:issue:`52335`)
6060
- :meth:`Series.plot` now correctly handle the ``ylabel`` parameter for pie charts, allowing for explicit control over the y-axis label (:issue:`58239`)
6161
- :meth:`DataFrame.plot.scatter` argument ``c`` now accepts a column of strings, where rows with the same string are colored identically (:issue:`16827` and :issue:`16485`)
62+
- :class:`DataFrameGroupBy` and :class:`SeriesGroupBy` methods ``sum``, ``mean``, ``median``, ``prod``, ``min``, ``max``, ``std``, ``var`` and ``sem`` now accept ``skipna`` parameter (:issue:`15675`)
6263
- :class:`Rolling` and :class:`Expanding` now support aggregations ``first`` and ``last`` (:issue:`33155`)
6364
- :func:`read_parquet` accepts ``to_pandas_kwargs`` which are forwarded to :meth:`pyarrow.Table.to_pandas` which enables passing additional keywords to customize the conversion to pandas, such as ``maps_as_pydicts`` to read the Parquet map data type as python dictionaries (:issue:`56842`)
64-
- :meth:`.DataFrameGroupBy.mean`, :meth:`.DataFrameGroupBy.sum`, :meth:`.SeriesGroupBy.mean` and :meth:`.SeriesGroupBy.sum` now accept ``skipna`` parameter (:issue:`15675`)
6565
- :meth:`.DataFrameGroupBy.transform`, :meth:`.SeriesGroupBy.transform`, :meth:`.DataFrameGroupBy.agg`, :meth:`.SeriesGroupBy.agg`, :meth:`.SeriesGroupBy.apply`, :meth:`.DataFrameGroupBy.apply` now support ``kurt`` (:issue:`40139`)
6666
- :meth:`DataFrameGroupBy.transform`, :meth:`SeriesGroupBy.transform`, :meth:`DataFrameGroupBy.agg`, :meth:`SeriesGroupBy.agg`, :meth:`RollingGroupby.apply`, :meth:`ExpandingGroupby.apply`, :meth:`Rolling.apply`, :meth:`Expanding.apply`, :meth:`DataFrame.apply` with ``engine="numba"`` now supports positional arguments passed as kwargs (:issue:`58995`)
6767
- :meth:`Rolling.agg`, :meth:`Expanding.agg` and :meth:`ExponentialMovingWindow.agg` now accept :class:`NamedAgg` aggregations through ``**kwargs`` (:issue:`28333`)

pandas/_config/config.py

+5
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ def reset_option(pat: str) -> None:
321321
"""
322322
Reset one or more options to their default value.
323323
324+
This method resets the specified pandas option(s) back to their default
325+
values. It allows partial string matching for convenience, but users should
326+
exercise caution to avoid unintended resets due to changes in option names
327+
in future versions.
328+
324329
Parameters
325330
----------
326331
pat : str/regex

pandas/_libs/groupby.pyi

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def group_median_float64(
1313
mask: np.ndarray | None = ...,
1414
result_mask: np.ndarray | None = ...,
1515
is_datetimelike: bool = ..., # bint
16+
skipna: bool = ...,
1617
) -> None: ...
1718
def group_cumprod(
1819
out: np.ndarray, # float64_t[:, ::1]
@@ -76,6 +77,7 @@ def group_prod(
7677
mask: np.ndarray | None,
7778
result_mask: np.ndarray | None = ...,
7879
min_count: int = ...,
80+
skipna: bool = ...,
7981
) -> None: ...
8082
def group_var(
8183
out: np.ndarray, # floating[:, ::1]
@@ -88,6 +90,7 @@ def group_var(
8890
result_mask: np.ndarray | None = ...,
8991
is_datetimelike: bool = ...,
9092
name: str = ...,
93+
skipna: bool = ...,
9194
) -> None: ...
9295
def group_skew(
9396
out: np.ndarray, # float64_t[:, ::1]
@@ -183,6 +186,7 @@ def group_max(
183186
is_datetimelike: bool = ...,
184187
mask: np.ndarray | None = ...,
185188
result_mask: np.ndarray | None = ...,
189+
skipna: bool = ...,
186190
) -> None: ...
187191
def group_min(
188192
out: np.ndarray, # groupby_t[:, ::1]
@@ -193,6 +197,7 @@ def group_min(
193197
is_datetimelike: bool = ...,
194198
mask: np.ndarray | None = ...,
195199
result_mask: np.ndarray | None = ...,
200+
skipna: bool = ...,
196201
) -> None: ...
197202
def group_idxmin_idxmax(
198203
out: npt.NDArray[np.intp],

0 commit comments

Comments
 (0)