Skip to content

Commit 4e682a8

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cln/comps
2 parents c0ca275 + 04424b0 commit 4e682a8

File tree

410 files changed

+5898
-4822
lines changed

Some content is hidden

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

410 files changed

+5898
-4822
lines changed

.circleci/config.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
5555
. ~/virtualenvs/pandas-dev/bin/activate
5656
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
57-
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
57+
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
5858
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
5959
python -m pip list --no-cache-dir
6060
export PANDAS_CI=1
@@ -141,11 +141,9 @@ workflows:
141141
only: /^v.*/
142142
matrix:
143143
parameters:
144-
cibw-build: ["cp39-manylinux_aarch64",
145-
"cp310-manylinux_aarch64",
144+
cibw-build: ["cp310-manylinux_aarch64",
146145
"cp311-manylinux_aarch64",
147146
"cp312-manylinux_aarch64",
148-
"cp39-musllinux_aarch64",
149147
"cp310-musllinux_aarch64",
150148
"cp311-musllinux_aarch64",
151149
"cp312-musllinux_aarch64",]

.github/actions/build_pandas/action.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ inputs:
44
editable:
55
description: Whether to build pandas in editable mode (default true)
66
default: true
7-
meson_args:
8-
description: Extra flags to pass to meson
9-
required: false
10-
cflags_adds:
11-
description: Items to append to the CFLAGS variable
12-
required: false
137
runs:
148
using: composite
159
steps:
@@ -30,12 +24,11 @@ runs:
3024

3125
- name: Build Pandas
3226
run: |
33-
export CFLAGS="$CFLAGS ${{ inputs.cflags_adds }}"
3427
if [[ ${{ inputs.editable }} == "true" ]]; then
35-
pip install -e . --no-build-isolation -v --no-deps ${{ inputs.meson_args }} \
28+
pip install -e . --no-build-isolation -v --no-deps \
3629
--config-settings=setup-args="--werror"
3730
else
38-
pip install . --no-build-isolation -v --no-deps ${{ inputs.meson_args }} \
31+
pip install . --no-build-isolation -v --no-deps \
3932
--config-settings=setup-args="--werror"
4033
fi
4134
shell: bash -el {0}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ runs:
77
shell: bash -el {0}
88

99
- name: Publish test results
10-
uses: actions/upload-artifact@v3
10+
uses: actions/upload-artifact@v4
1111
with:
1212
name: Test results
1313
path: test-data.xml
1414
if: failure()
1515

1616
- name: Upload coverage to Codecov
17-
uses: codecov/codecov-action@v3
17+
uses: codecov/codecov-action@v4
1818
with:
1919
flags: unittests
2020
name: codecov-pandas

.github/workflows/package-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
runs-on: ubuntu-22.04
5454
strategy:
5555
matrix:
56-
python-version: ['3.9', '3.10', '3.11']
56+
python-version: ['3.10', '3.11']
5757
fail-fast: false
5858
name: Test Conda Forge Recipe - Python ${{ matrix.python-version }}
5959
concurrency:

.github/workflows/unit-tests.yml

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
timeout-minutes: 90
2727
strategy:
2828
matrix:
29-
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
29+
env_file: [actions-310.yaml, actions-311.yaml, actions-312.yaml]
3030
# Prevent the include jobs from overriding other jobs
3131
pattern: [""]
3232
include:
@@ -35,7 +35,7 @@ jobs:
3535
pattern: "not slow and not network and not single_cpu"
3636
pytest_target: "pandas/tests/test_downstream.py"
3737
- name: "Minimum Versions"
38-
env_file: actions-39-minimum_versions.yaml
38+
env_file: actions-310-minimum_versions.yaml
3939
pattern: "not slow and not network and not single_cpu"
4040
- name: "Locale: it_IT"
4141
env_file: actions-311.yaml
@@ -74,9 +74,9 @@ jobs:
7474
PATTERN: ${{ matrix.pattern }}
7575
LANG: ${{ matrix.lang || 'C.UTF-8' }}
7676
LC_ALL: ${{ matrix.lc_all || '' }}
77-
PANDAS_CI: ${{ matrix.pandas_ci || '1' }}
77+
PANDAS_CI: '1'
7878
TEST_ARGS: ${{ matrix.test_args || '' }}
79-
PYTEST_WORKERS: ${{ matrix.pytest_workers || 'auto' }}
79+
PYTEST_WORKERS: 'auto'
8080
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
8181
NPY_PROMOTION_STATE: ${{ matrix.env_file == 'actions-311-numpydev.yaml' && 'weak' || 'legacy' }}
8282
# Clipboard tests
@@ -88,7 +88,7 @@ jobs:
8888

8989
services:
9090
mysql:
91-
image: mysql:8.0.33
91+
image: mysql:8
9292
env:
9393
MYSQL_ALLOW_EMPTY_PASSWORD: yes
9494
MYSQL_DATABASE: pandas
@@ -101,7 +101,7 @@ jobs:
101101
- 3306:3306
102102

103103
postgres:
104-
image: postgres:13
104+
image: postgres:16
105105
env:
106106
PGUSER: postgres
107107
POSTGRES_USER: postgres
@@ -116,7 +116,7 @@ jobs:
116116
- 5432:5432
117117

118118
moto:
119-
image: motoserver/moto:4.1.13
119+
image: motoserver/moto:5.0.0
120120
env:
121121
AWS_ACCESS_KEY_ID: foobar_key
122122
AWS_SECRET_ACCESS_KEY: foobar_secret
@@ -146,9 +146,8 @@ jobs:
146146
- name: Build Pandas
147147
id: build
148148
uses: ./.github/actions/build_pandas
149-
with:
150-
meson_args: ${{ matrix.meson_args }}
151-
cflags_adds: ${{ matrix.cflags_adds }}
149+
# TODO: Re-enable once Pypy has Pypy 3.10 on conda-forge
150+
if: ${{ matrix.name != 'Pypy' }}
152151

153152
- name: Test (not single_cpu)
154153
uses: ./.github/actions/run-tests
@@ -170,7 +169,7 @@ jobs:
170169
matrix:
171170
# Note: Don't use macOS latest since macos 14 appears to be arm64 only
172171
os: [macos-13, macos-14, windows-latest]
173-
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
172+
env_file: [actions-310.yaml, actions-311.yaml, actions-312.yaml]
174173
fail-fast: false
175174
runs-on: ${{ matrix.os }}
176175
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
@@ -228,7 +227,7 @@ jobs:
228227
. ~/virtualenvs/pandas-dev/bin/activate
229228
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
230229
python -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
231-
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
230+
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
232231
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
233232
python -m pip list --no-cache-dir
234233
export PANDAS_CI=1
@@ -266,7 +265,7 @@ jobs:
266265
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
267266
. ~/virtualenvs/pandas-dev/bin/activate
268267
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
269-
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 hypothesis>=6.46.1
268+
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=3.4.0 hypothesis>=6.84.0
270269
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
271270
python -m pip list --no-cache-dir
272271
@@ -300,7 +299,7 @@ jobs:
300299
# To freeze this file, uncomment out the ``if: false`` condition, and migrate the jobs
301300
# to the corresponding posix/windows-macos/sdist etc. workflows.
302301
# Feel free to modify this comment as necessary.
303-
if: false # Uncomment this to freeze the workflow, comment it to unfreeze
302+
# if: false # Uncomment this to freeze the workflow, comment it to unfreeze
304303
defaults:
305304
run:
306305
shell: bash -eou pipefail {0}
@@ -315,7 +314,7 @@ jobs:
315314

316315
concurrency:
317316
# https://github.community/t/concurrecy-not-work-for-push/183068/7
318-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
317+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-python-dev
319318
cancel-in-progress: true
320319

321320
env:
@@ -332,21 +331,65 @@ jobs:
332331
- name: Set up Python Dev Version
333332
uses: actions/setup-python@v5
334333
with:
335-
python-version: '3.12-dev'
334+
python-version: '3.13-dev'
336335

337336
- name: Build Environment
338337
run: |
339338
python --version
340339
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
341340
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
342341
python -m pip install versioneer[toml]
343-
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
342+
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
343+
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
344+
python -m pip list
345+
346+
- name: Run Tests
347+
uses: ./.github/actions/run-tests
348+
349+
python-freethreading:
350+
defaults:
351+
run:
352+
shell: bash -eou pipefail {0}
353+
runs-on: ubuntu-22.04
354+
355+
timeout-minutes: 90
356+
357+
concurrency:
358+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
359+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-python-freethreading-dev
360+
cancel-in-progress: true
361+
362+
env:
363+
PYTEST_WORKERS: "auto"
364+
PANDAS_CI: 1
365+
PATTERN: "not slow and not network and not clipboard and not single_cpu"
366+
PYTEST_TARGET: pandas
367+
368+
steps:
369+
- uses: actions/checkout@v4
370+
with:
371+
fetch-depth: 0
372+
373+
- name: Set up Python Free-threading Version
374+
uses: deadsnakes/[email protected]
375+
with:
376+
python-version: 3.13-dev
377+
nogil: true
378+
379+
- name: Build Environment
380+
run: |
381+
python --version
382+
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
383+
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy cython
384+
python -m pip install versioneer[toml]
385+
python -m pip install python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
344386
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
345387
python -m pip list
346388
347389
- name: Run Tests
348390
uses: ./.github/actions/run-tests
349391

392+
# NOTE: this job must be kept in sync with the Pyodide build job in wheels.yml
350393
emscripten:
351394
# Note: the Python version, Emscripten toolchain version are determined
352395
# by the Pyodide version. The appropriate versions can be found in the

.github/workflows/wheels.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ jobs:
9999
- [macos-14, macosx_arm64]
100100
- [windows-2022, win_amd64]
101101
# TODO: support PyPy?
102-
python: [["cp39", "3.9"], ["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
102+
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
103+
104+
# Build Pyodide wheels and upload them to Anaconda.org
105+
# NOTE: this job is similar to the one in unit-tests.yml except for the fact
106+
# that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup.
107+
include:
108+
- buildplat: [ubuntu-22.04, pyodide_wasm32]
109+
python: ["cp312", "3.12"]
103110
env:
104111
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
105112
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -140,12 +147,13 @@ jobs:
140147
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
141148

142149
- name: Build wheels
143-
uses: pypa/cibuildwheel@v2.18.1
150+
uses: pypa/cibuildwheel@v2.19.2
144151
with:
145152
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
146153
env:
147154
CIBW_PRERELEASE_PYTHONS: True
148155
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
156+
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}
149157

150158
- name: Set up Python
151159
uses: mamba-org/setup-micromamba@v1
@@ -170,7 +178,7 @@ jobs:
170178
shell: pwsh
171179
run: |
172180
$TST_CMD = @"
173-
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0;
181+
python -m pip install hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0;
174182
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
175183
python -c `'import pandas as pd; pd.test(extra_args=[`\"--no-strict-data-files`\", `\"-m not clipboard and not single_cpu and not slow and not network and not db`\"])`';
176184
"@

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
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.4.7
22+
rev: v0.5.0
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -67,15 +67,16 @@ repos:
6767
- id: fix-encoding-pragma
6868
args: [--remove]
6969
- id: trailing-whitespace
70+
args: [--markdown-linebreak-ext=md]
7071
- repo: https://github.com/PyCQA/isort
7172
rev: 5.13.2
7273
hooks:
7374
- id: isort
7475
- repo: https://github.com/asottile/pyupgrade
75-
rev: v3.15.2
76+
rev: v3.16.0
7677
hooks:
7778
- id: pyupgrade
78-
args: [--py39-plus]
79+
args: [--py310-plus]
7980
- repo: https://github.com/pre-commit/pygrep-hooks
8081
rev: v1.10.0
8182
hooks:
@@ -92,7 +93,7 @@ repos:
9293
- id: sphinx-lint
9394
args: ["--enable", "all", "--disable", "line-too-long"]
9495
- repo: https://github.com/pre-commit/mirrors-clang-format
95-
rev: v18.1.5
96+
rev: v18.1.8
9697
hooks:
9798
- id: clang-format
9899
files: ^pandas/_libs/src|^pandas/_libs/include

asv_bench/benchmarks/indexing.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -546,24 +546,17 @@ def time_chained_indexing(self, mode):
546546

547547

548548
class Block:
549-
params = [
550-
(True, "True"),
551-
(np.array(True), "np.array(True)"),
552-
]
553-
554-
def setup(self, true_value, mode):
549+
def setup(self):
555550
self.df = DataFrame(
556551
False,
557552
columns=np.arange(500).astype(str),
558553
index=date_range("2010-01-01", "2011-01-01"),
559554
)
560555

561-
self.true_value = true_value
562-
563-
def time_test(self, true_value, mode):
556+
def time_test(self):
564557
start = datetime(2010, 5, 1)
565558
end = datetime(2010, 9, 1)
566-
self.df.loc[start:end, :] = true_value
559+
self.df.loc[start:end, :] = True
567560

568561

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

asv_bench/benchmarks/tslibs/timedelta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def time_from_int(self):
2020
Timedelta(123456789)
2121

2222
def time_from_unit(self):
23-
Timedelta(1, unit="d")
23+
Timedelta(1, unit="D")
2424

2525
def time_from_components(self):
2626
Timedelta(

0 commit comments

Comments
 (0)