Skip to content

Commit e58e8b3

Browse files
committed
Merge remote-tracking branch 'upstream/main' into string_dtype_tests
# Conflicts: # doc/source/whatsnew/v2.1.2.rst # pandas/conftest.py # pandas/core/arrays/base.py # pandas/tests/frame/indexing/test_indexing.py # pandas/tests/frame/methods/test_cov_corr.py # pandas/tests/frame/methods/test_update.py # pandas/tests/frame/methods/test_value_counts.py # pandas/tests/frame/test_repr.py # pandas/tests/groupby/test_apply.py # pandas/tests/groupby/test_numeric_only.py # pandas/tests/groupby/test_reductions.py
2 parents 05f1c95 + 46c8da3 commit e58e8b3

File tree

863 files changed

+41449
-29252
lines changed

Some content is hidden

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

863 files changed

+41449
-29252
lines changed

.circleci/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ jobs:
4949
no_output_timeout: 30m # Sometimes the tests won't generate any output, make sure the job doesn't get killed by that
5050
command: |
5151
pip3 install cibuildwheel==2.15.0
52+
# When this is a nightly wheel build, allow picking up NumPy 2.0 dev wheels:
53+
if [[ "$IS_SCHEDULE_DISPATCH" == "true" || "$IS_PUSH" != 'true' ]]; then
54+
export CIBW_ENVIRONMENT="PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
55+
fi
5256
cibuildwheel --prerelease-pythons --output-dir wheelhouse
57+
5358
environment:
5459
CIBW_BUILD: << parameters.cibw-build >>
5560

.circleci/setup_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ if pip show pandas 1>/dev/null; then
5555
fi
5656

5757
echo "Install pandas"
58-
python -m pip install --no-build-isolation -ve .
58+
python -m pip install --no-build-isolation -ve . --config-settings=setup-args="--werror"
5959

6060
echo "done"

.github/actions/build_pandas/action.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ runs:
2525
- name: Build Pandas
2626
run: |
2727
if [[ ${{ inputs.editable }} == "true" ]]; then
28-
pip install -e . --no-build-isolation -v --no-deps
28+
pip install -e . --no-build-isolation -v --no-deps \
29+
--config-settings=setup-args="--werror"
2930
else
30-
pip install . --no-build-isolation -v --no-deps
31+
pip install . --no-build-isolation -v --no-deps \
32+
--config-settings=setup-args="--werror"
3133
fi
3234
shell: bash -el {0}
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Linkcheck
2+
on:
3+
schedule:
4+
# Run monthly on the 1st day of the month
5+
- cron: '0 0 1 * *'
6+
pull_request:
7+
paths:
8+
- ".github/workflows/broken-linkcheck.yml"
9+
- "doc/make.py"
10+
jobs:
11+
linkcheck:
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
shell: bash -el {0}
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Conda
24+
uses: ./.github/actions/setup-conda
25+
26+
- name: Build Pandas
27+
uses: ./.github/actions/build_pandas
28+
29+
- name: Run linkcheck script
30+
working-directory: ./doc
31+
run: |
32+
set -o pipefail
33+
python make.py linkcheck | tee linkcheck.txt
34+
35+
- name: Display broken links
36+
if: failure()
37+
working-directory: ./doc
38+
run: grep broken linkcheck.txt

.github/workflows/comment-commands.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
echo 'EOF' >> $GITHUB_ENV
7878
echo "REGEX=$REGEX" >> $GITHUB_ENV
7979
80-
- uses: actions/github-script@v6
80+
- uses: actions/github-script@v7
8181
env:
8282
BENCH_OUTPUT: ${{env.BENCH_OUTPUT}}
8383
REGEX: ${{env.REGEX}}

.github/workflows/deprecation-tracking-bot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
env:
2222
DEPRECATION_TRACKER_ISSUE: 50578
2323
steps:
24-
- uses: actions/github-script@v6
24+
- uses: actions/github-script@v7
2525
id: update-deprecation-issue
2626
with:
2727
script: |

.github/workflows/unit-tests.yml

+33-16
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ defaults:
2323
jobs:
2424
ubuntu:
2525
runs-on: ubuntu-22.04
26-
timeout-minutes: 180
26+
timeout-minutes: 90
2727
strategy:
2828
matrix:
29-
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
29+
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
3030
# Prevent the include jobs from overriding other jobs
3131
pattern: [""]
3232
include:
@@ -69,6 +69,22 @@ jobs:
6969
env_file: actions-311.yaml
7070
pattern: "not slow and not network and not single_cpu"
7171
pandas_copy_on_write: "1"
72+
- name: "Copy-on-Write 3.12"
73+
env_file: actions-312.yaml
74+
pattern: "not slow and not network and not single_cpu"
75+
pandas_copy_on_write: "1"
76+
- name: "Copy-on-Write 3.11 (warnings)"
77+
env_file: actions-311.yaml
78+
pattern: "not slow and not network and not single_cpu"
79+
pandas_copy_on_write: "warn"
80+
- name: "Copy-on-Write 3.10 (warnings)"
81+
env_file: actions-310.yaml
82+
pattern: "not slow and not network and not single_cpu"
83+
pandas_copy_on_write: "warn"
84+
- name: "Copy-on-Write 3.9 (warnings)"
85+
env_file: actions-39.yaml
86+
pattern: "not slow and not network and not single_cpu"
87+
pandas_copy_on_write: "warn"
7288
- name: "Pypy"
7389
env_file: actions-pypy-39.yaml
7490
pattern: "not slow and not network and not single_cpu"
@@ -84,17 +100,18 @@ jobs:
84100
name: ${{ matrix.name || format('ubuntu-latest {0}', matrix.env_file) }}
85101
env:
86102
PATTERN: ${{ matrix.pattern }}
87-
EXTRA_APT: ${{ matrix.extra_apt || '' }}
88103
LANG: ${{ matrix.lang || 'C.UTF-8' }}
89104
LC_ALL: ${{ matrix.lc_all || '' }}
90105
PANDAS_COPY_ON_WRITE: ${{ matrix.pandas_copy_on_write || '0' }}
91106
PANDAS_CI: ${{ matrix.pandas_ci || '1' }}
92107
TEST_ARGS: ${{ matrix.test_args || '' }}
93108
PYTEST_WORKERS: 'auto'
94109
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
110+
# Clipboard tests
111+
QT_QPA_PLATFORM: offscreen
95112
concurrency:
96113
# https://github.community/t/concurrecy-not-work-for-push/183068/7
97-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.extra_apt || '' }}
114+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.env_file }}-${{ matrix.pattern }}-${{ matrix.extra_apt || '' }}-${{ matrix.pandas_copy_on_write || '' }}
98115
cancel-in-progress: true
99116

100117
services:
@@ -141,8 +158,8 @@ jobs:
141158
fetch-depth: 0
142159

143160
- name: Extra installs
144-
# xsel for clipboard tests
145-
run: sudo apt-get update && sudo apt-get install -y xsel ${{ env.EXTRA_APT }}
161+
run: sudo apt-get update && sudo apt-get install -y ${{ matrix.extra_apt }}
162+
if: ${{ matrix.extra_apt }}
146163

147164
- name: Generate extra locales
148165
# These extra locales will be available for locale.setlocale() calls in tests
@@ -173,11 +190,11 @@ jobs:
173190
if: ${{ matrix.pattern == '' && (always() && steps.build.outcome == 'success')}}
174191

175192
macos-windows:
176-
timeout-minutes: 180
193+
timeout-minutes: 90
177194
strategy:
178195
matrix:
179196
os: [macos-latest, windows-latest]
180-
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml]
197+
env_file: [actions-39.yaml, actions-310.yaml, actions-311.yaml, actions-312.yaml]
181198
fail-fast: false
182199
runs-on: ${{ matrix.os }}
183200
name: ${{ format('{0} {1}', matrix.os, matrix.env_file) }}
@@ -236,8 +253,8 @@ jobs:
236253
. ~/virtualenvs/pandas-dev/bin/activate
237254
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
238255
python -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
239-
python -m pip install --no-cache-dir versioneer[toml] cython python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
240-
python -m pip install --no-cache-dir --no-build-isolation -e .
256+
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
257+
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
241258
python -m pip list --no-cache-dir
242259
export PANDAS_CI=1
243260
python -m pytest -m 'not slow and not network and not clipboard and not single_cpu' pandas --junitxml=test-data.xml
@@ -274,8 +291,8 @@ jobs:
274291
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
275292
. ~/virtualenvs/pandas-dev/bin/activate
276293
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
277-
python -m pip install --no-cache-dir versioneer[toml] cython numpy python-dateutil pytz pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 hypothesis>=6.46.1
278-
python -m pip install --no-cache-dir --no-build-isolation -e .
294+
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
295+
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
279296
python -m pip list --no-cache-dir
280297
281298
- name: Run Tests
@@ -308,7 +325,7 @@ jobs:
308325
# To freeze this file, uncomment out the ``if: false`` condition, and migrate the jobs
309326
# to the corresponding posix/windows-macos/sdist etc. workflows.
310327
# Feel free to modify this comment as necessary.
311-
#if: false # Uncomment this to freeze the workflow, comment it to unfreeze
328+
if: false # Uncomment this to freeze the workflow, comment it to unfreeze
312329
defaults:
313330
run:
314331
shell: bash -eou pipefail {0}
@@ -318,7 +335,7 @@ jobs:
318335
matrix:
319336
os: [ubuntu-22.04, macOS-latest, windows-latest]
320337

321-
timeout-minutes: 180
338+
timeout-minutes: 90
322339

323340
concurrency:
324341
#https://github.community/t/concurrecy-not-work-for-push/183068/7
@@ -347,8 +364,8 @@ jobs:
347364
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
348365
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
349366
python -m pip install versioneer[toml]
350-
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov pytest-asyncio>=0.17
351-
python -m pip install -ve . --no-build-isolation --no-index --no-deps
367+
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
368+
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
352369
python -m pip list
353370
354371
- name: Run Tests

.github/workflows/wheels.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,27 @@ jobs:
137137
shell: bash -el {0}
138138
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
139139

140-
- name: Build wheels
140+
- name: Build normal wheels
141+
if: ${{ (env.IS_SCHEDULE_DISPATCH != 'true' || env.IS_PUSH == 'true') }}
141142
uses: pypa/[email protected]
142143
with:
143144
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
144145
env:
145146
CIBW_PRERELEASE_PYTHONS: True
146147
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
147148

149+
- name: Build nightly wheels (with NumPy pre-release)
150+
if: ${{ (env.IS_SCHEDULE_DISPATCH == 'true' && env.IS_PUSH != 'true') }}
151+
uses: pypa/[email protected]
152+
with:
153+
package-dir: ./dist/${{ matrix.buildplat[1] == 'macosx_*' && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
154+
env:
155+
# The nightly wheels should be build witht he NumPy 2.0 pre-releases
156+
# which requires the additional URL.
157+
CIBW_ENVIRONMENT: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
158+
CIBW_PRERELEASE_PYTHONS: True
159+
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
160+
148161
- name: Set up Python
149162
uses: mamba-org/setup-micromamba@v1
150163
with:
@@ -168,7 +181,7 @@ jobs:
168181
shell: pwsh
169182
run: |
170183
$TST_CMD = @"
171-
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-asyncio>=0.17;
184+
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0;
172185
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
173186
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`\"\"])`';
174187
"@

.gitignore

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
.mesonpy-native-file.ini
4040
MANIFEST
4141
compile_commands.json
42+
debug
4243
.debug
4344

4445
# Python files #
@@ -104,10 +105,11 @@ scikits
104105
# Generated Sources #
105106
#####################
106107
!skts.c
107-
!np_datetime.c
108-
!np_datetime_strings.c
109108
*.c
110109
*.cpp
110+
!pandas/_libs/src/**/*.c
111+
!pandas/_libs/src/**/*.h
112+
!pandas/_libs/include/**/*.h
111113

112114
# Unit / Performance Testing #
113115
##############################

.pre-commit-config.yaml

+18-23
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ ci:
2020
repos:
2121
- repo: https://github.com/hauntsaninja/black-pre-commit-mirror
2222
# black compiled with mypyc
23-
rev: 23.9.1
23+
rev: 23.11.0
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/astral-sh/ruff-pre-commit
27-
rev: v0.0.291
27+
rev: v0.1.6
2828
hooks:
2929
- id: ruff
3030
args: [--exit-non-zero-on-fix]
@@ -34,25 +34,25 @@ repos:
3434
alias: ruff-selected-autofixes
3535
args: [--select, "ANN001,ANN204", --fix-only, --exit-non-zero-on-fix]
3636
- repo: https://github.com/jendrikseipp/vulture
37-
rev: 'v2.9.1'
37+
rev: 'v2.10'
3838
hooks:
3939
- id: vulture
4040
entry: python scripts/run_vulture.py
4141
pass_filenames: true
4242
require_serial: false
4343
- repo: https://github.com/codespell-project/codespell
44-
rev: v2.2.5
44+
rev: v2.2.6
4545
hooks:
4646
- id: codespell
4747
types_or: [python, rst, markdown, cython, c]
4848
additional_dependencies: [tomli]
4949
- repo: https://github.com/MarcoGorelli/cython-lint
50-
rev: v0.15.0
50+
rev: v0.16.0
5151
hooks:
5252
- id: cython-lint
5353
- id: double-quote-cython-strings
5454
- repo: https://github.com/pre-commit/pre-commit-hooks
55-
rev: v4.4.0
55+
rev: v4.5.0
5656
hooks:
5757
- id: check-ast
5858
- id: check-case-conflict
@@ -70,21 +70,8 @@ repos:
7070
- id: fix-encoding-pragma
7171
args: [--remove]
7272
- id: trailing-whitespace
73-
- repo: https://github.com/cpplint/cpplint
74-
rev: 1.6.1
75-
hooks:
76-
- id: cpplint
77-
exclude: ^pandas/_libs/include/pandas/vendored/klib
78-
args: [
79-
--quiet,
80-
'--extensions=c,h',
81-
'--headers=h',
82-
--recursive,
83-
--linelength=88,
84-
'--filter=-readability/casting,-runtime/int,-build/include_subdir,-readability/fn_size'
85-
]
8673
- repo: https://github.com/pylint-dev/pylint
87-
rev: v3.0.0b0
74+
rev: v3.0.1
8875
hooks:
8976
- id: pylint
9077
stages: [manual]
@@ -107,7 +94,7 @@ repos:
10794
hooks:
10895
- id: isort
10996
- repo: https://github.com/asottile/pyupgrade
110-
rev: v3.13.0
97+
rev: v3.15.0
11198
hooks:
11299
- id: pyupgrade
113100
args: [--py39-plus]
@@ -124,9 +111,16 @@ repos:
124111
types: [text] # overwrite types: [rst]
125112
types_or: [python, rst]
126113
- repo: https://github.com/sphinx-contrib/sphinx-lint
127-
rev: v0.6.8
114+
rev: v0.9.0
128115
hooks:
129116
- id: sphinx-lint
117+
- repo: https://github.com/pre-commit/mirrors-clang-format
118+
rev: v17.0.6
119+
hooks:
120+
- id: clang-format
121+
files: ^pandas/_libs/src|^pandas/_libs/include
122+
args: [-i]
123+
types_or: [c, c++]
130124
- repo: local
131125
hooks:
132126
- id: pyright
@@ -246,8 +240,9 @@ repos:
246240
# pytest raises without context
247241
|\s\ pytest.raises
248242
243+
# TODO
249244
# pytest.warns (use tm.assert_produces_warning instead)
250-
|pytest\.warns
245+
# |pytest\.warns
251246
252247
# os.remove
253248
|os\.remove

asv_bench/asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
// pip (with all the conda available packages installed first,
4242
// followed by the pip installed packages).
4343
"matrix": {
44-
"Cython": ["0.29.33"],
44+
"Cython": ["3.0.5"],
4545
"matplotlib": [],
4646
"sqlalchemy": [],
4747
"scipy": [],

0 commit comments

Comments
 (0)