Skip to content

Commit 747756f

Browse files
authored
Merge branch 'main' into BUG-56994/pyarrow-assignment-unexpected-dtypes
2 parents 5dadf0e + 9b375be commit 747756f

File tree

308 files changed

+3780
-2782
lines changed

Some content is hidden

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

308 files changed

+3780
-2782
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
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

.gitattributes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ci export-ignore
6868
doc export-ignore
6969
gitpod export-ignore
7070
MANIFEST.in export-ignore
71-
scripts export-ignore
71+
scripts/** export-ignore
7272
typings export-ignore
7373
web export-ignore
7474
CITATION.cff export-ignore
@@ -82,3 +82,7 @@ setup.py export-ignore
8282
# csv_dir_path fixture checks the existence of the directory
8383
# exclude the whole directory to avoid running related tests in sdist
8484
pandas/tests/io/parser/data export-ignore
85+
86+
# Include cibw script in sdist since it's needed for building wheels
87+
scripts/cibw_before_build.sh -export-ignore
88+
scripts/cibw_before_test.sh -export-ignore

.github/workflows/unit-tests.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ jobs:
5757
# Also install zh_CN (its encoding is gb2312) but do not activate it.
5858
# It will be temporarily activated during tests with locale.setlocale
5959
extra_loc: "zh_CN"
60+
- name: "Future infer strings"
61+
env_file: actions-311.yaml
62+
pattern: "not slow and not network and not single_cpu"
63+
pandas_future_infer_string: "1"
6064
- name: "Pypy"
6165
env_file: actions-pypy-39.yaml
6266
pattern: "not slow and not network and not single_cpu"
@@ -75,6 +79,7 @@ jobs:
7579
LANG: ${{ matrix.lang || 'C.UTF-8' }}
7680
LC_ALL: ${{ matrix.lc_all || '' }}
7781
PANDAS_CI: '1'
82+
PANDAS_FUTURE_INFER_STRING: ${{ matrix.pandas_future_infer_string || '0' }}
7883
TEST_ARGS: ${{ matrix.test_args || '' }}
7984
PYTEST_WORKERS: 'auto'
8085
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
@@ -227,7 +232,7 @@ jobs:
227232
. ~/virtualenvs/pandas-dev/bin/activate
228233
python -m pip install --no-cache-dir -U pip wheel setuptools meson[ninja]==1.2.1 meson-python==0.13.1
229234
python -m pip install numpy --config-settings=setup-args="-Dallow-noblas=true"
230-
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
235+
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
231236
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
232237
python -m pip list --no-cache-dir
233238
export PANDAS_CI=1
@@ -265,7 +270,7 @@ jobs:
265270
/opt/python/cp311-cp311/bin/python -m venv ~/virtualenvs/pandas-dev
266271
. ~/virtualenvs/pandas-dev/bin/activate
267272
python -m pip install --no-cache-dir -U pip wheel setuptools meson-python==0.13.1 meson[ninja]==1.2.1
268-
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
273+
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
269274
python -m pip install --no-cache-dir --no-build-isolation -e . --config-settings=setup-args="--werror"
270275
python -m pip list --no-cache-dir
271276
@@ -339,7 +344,7 @@ jobs:
339344
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
340345
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
341346
python -m pip install versioneer[toml]
342-
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
347+
python -m pip install python-dateutil pytz tzdata cython hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
343348
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
344349
python -m pip list
345350
@@ -382,15 +387,14 @@ jobs:
382387
python -m pip install --upgrade pip setuptools wheel meson[ninja]==1.2.1 meson-python==0.13.1
383388
python -m pip install --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy cython
384389
python -m pip install versioneer[toml]
385-
python -m pip install python-dateutil pytz tzdata hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
390+
python -m pip install python-dateutil pytz tzdata hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0 pytest-cov
386391
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
387392
python -m pip list
388393
389394
- name: Run Tests
390395
uses: ./.github/actions/run-tests
391-
env:
392-
PYTHON_GIL: 0
393396

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

.github/workflows/wheels.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,25 @@ jobs:
9999
- [macos-14, macosx_arm64]
100100
- [windows-2022, win_amd64]
101101
# TODO: support PyPy?
102-
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"]]
102+
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"], ["cp313", "3.13"], ["cp313t", "3.13"]]
103+
include:
104+
# TODO: Remove this plus installing build deps in cibw_before_build.sh
105+
# and test deps in cibw_before_test.sh after pandas can be built with a released NumPy/Cython
106+
- python: ["cp313", "3.13"]
107+
cibw_build_frontend: 'pip; args: --no-build-isolation'
108+
- python: ["cp313t", "3.13"]
109+
cibw_build_frontend: 'pip; args: --no-build-isolation'
110+
# Build Pyodide wheels and upload them to Anaconda.org
111+
# NOTE: this job is similar to the one in unit-tests.yml except for the fact
112+
# that it uses cibuildwheel instead of a standard Pyodide xbuildenv setup.
113+
- buildplat: [ubuntu-22.04, pyodide_wasm32]
114+
python: ["cp312", "3.12"]
115+
cibw_build_frontend: 'build'
116+
# TODO: Build free-threaded wheels for Windows
117+
exclude:
118+
- buildplat: [windows-2022, win_amd64]
119+
python: ["cp313t", "3.13"]
120+
103121
env:
104122
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
105123
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -140,12 +158,14 @@ jobs:
140158
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
141159

142160
- name: Build wheels
143-
uses: pypa/[email protected].1
161+
uses: pypa/[email protected].2
144162
with:
145163
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
146164
env:
147165
CIBW_PRERELEASE_PYTHONS: True
148166
CIBW_BUILD: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
167+
CIBW_BUILD_FRONTEND: ${{ matrix.cibw_build_frontend || 'pip' }}
168+
CIBW_PLATFORM: ${{ matrix.buildplat[1] == 'pyodide_wasm32' && 'pyodide' || 'auto' }}
149169

150170
- name: Set up Python
151171
uses: mamba-org/setup-micromamba@v1
@@ -168,15 +188,17 @@ jobs:
168188
- name: Test Windows Wheels
169189
if: ${{ matrix.buildplat[1] == 'win_amd64' }}
170190
shell: pwsh
191+
# TODO: Remove NumPy nightly install when there's a 3.13 wheel on PyPI
171192
run: |
172193
$TST_CMD = @"
173-
python -m pip install hypothesis>=6.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0;
194+
python -m pip install hypothesis>=6.84.0 pytest>=7.3.2 pytest-xdist>=3.4.0;
195+
${{ matrix.python[1] == '3.13' && 'python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;' }}
174196
python -m pip install `$(Get-Item pandas\wheelhouse\*.whl);
175197
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`\"])`';
176198
"@
177199
# add rc to the end of the image name if the Python version is unreleased
178-
docker pull python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }}
179-
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] == '3.12' && '3.12-rc' || format('{0}-windowsservercore', matrix.python[1]) }} powershell -Command $TST_CMD
200+
docker pull python:${{ matrix.python[1] == '3.13' && '3.13-rc' || format('{0}-windowsservercore', matrix.python[1]) }}
201+
docker run --env PANDAS_CI='1' -v ${PWD}:C:\pandas python:${{ matrix.python[1] == '3.13' && '3.13-rc' || format('{0}-windowsservercore', matrix.python[1]) }} powershell -Command $TST_CMD
180202
181203
- uses: actions/upload-artifact@v4
182204
with:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 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]
@@ -73,7 +73,7 @@ repos:
7373
hooks:
7474
- id: isort
7575
- repo: https://github.com/asottile/pyupgrade
76-
rev: v3.15.2
76+
rev: v3.16.0
7777
hooks:
7878
- id: pyupgrade
7979
args: [--py310-plus]
@@ -93,7 +93,7 @@ repos:
9393
- id: sphinx-lint
9494
args: ["--enable", "all", "--disable", "line-too-long"]
9595
- repo: https://github.com/pre-commit/mirrors-clang-format
96-
rev: v18.1.5
96+
rev: v18.1.8
9797
hooks:
9898
- id: clang-format
9999
files: ^pandas/_libs/src|^pandas/_libs/include

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ prune pandas/tests/io/parser/data
6262
# Selectively re-add *.cxx files that were excluded above
6363
graft pandas/_libs/src
6464
graft pandas/_libs/include
65+
66+
# Include cibw script in sdist since it's needed for building wheels
67+
include scripts/cibw_before_build.sh
68+
include scripts/cibw_before_test.sh

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ The source code is currently hosted on GitHub at:
9696
https://github.com/pandas-dev/pandas
9797

9898
Binary installers for the latest released version are available at the [Python
99-
Package Index (PyPI)](https://pypi.org/project/pandas) and on [Conda](https://docs.conda.io/en/latest/).
99+
Package Index (PyPI)](https://pypi.org/project/pandas) and on [Conda](https://anaconda.org/conda-forge/pandas).
100100

101101
```sh
102102
# conda

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

ci/code_checks.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7070
--format=actions \
7171
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7272
-i "pandas.Series.dt PR01" `# Accessors are implemented as classes, but we do not document the Parameters section` \
73-
-i "pandas.DataFrame.max RT03" \
74-
-i "pandas.DataFrame.mean RT03" \
75-
-i "pandas.DataFrame.median RT03" \
76-
-i "pandas.DataFrame.min RT03" \
77-
-i "pandas.DataFrame.plot PR02" \
78-
-i "pandas.Grouper PR02" \
7973
-i "pandas.MultiIndex.append PR07,SA01" \
8074
-i "pandas.MultiIndex.copy PR07,RT03,SA01" \
81-
-i "pandas.MultiIndex.drop PR07,RT03,SA01" \
8275
-i "pandas.MultiIndex.get_level_values SA01" \
8376
-i "pandas.MultiIndex.get_loc PR07" \
8477
-i "pandas.MultiIndex.get_loc_level PR07" \
@@ -95,7 +88,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9588
-i "pandas.Period.freq GL08" \
9689
-i "pandas.Period.freqstr SA01" \
9790
-i "pandas.Period.month SA01" \
98-
-i "pandas.Period.now SA01" \
9991
-i "pandas.Period.ordinal GL08" \
10092
-i "pandas.Period.strftime PR01,SA01" \
10193
-i "pandas.Period.to_timestamp SA01" \
@@ -161,13 +153,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
161153
-i "pandas.Series.lt SA01" \
162154
-i "pandas.Series.ne SA01" \
163155
-i "pandas.Series.pad PR01,SA01" \
164-
-i "pandas.Series.plot PR02" \
165156
-i "pandas.Series.pop SA01" \
166157
-i "pandas.Series.prod RT03" \
167158
-i "pandas.Series.product RT03" \
168159
-i "pandas.Series.reorder_levels RT03,SA01" \
169160
-i "pandas.Series.sem PR01,RT03,SA01" \
170-
-i "pandas.Series.skew RT03,SA01" \
171161
-i "pandas.Series.sparse PR01,SA01" \
172162
-i "pandas.Series.sparse.density SA01" \
173163
-i "pandas.Series.sparse.fill_value SA01" \
@@ -205,8 +195,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
205195
-i "pandas.Series.str.wrap RT03,SA01" \
206196
-i "pandas.Series.str.zfill RT03" \
207197
-i "pandas.Series.struct.dtypes SA01" \
208-
-i "pandas.Series.to_dict SA01" \
209-
-i "pandas.Series.to_frame SA01" \
210198
-i "pandas.Series.to_markdown SA01" \
211199
-i "pandas.Series.update PR07,SA01" \
212200
-i "pandas.Timedelta.asm8 SA01" \
@@ -244,13 +232,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
244232
-i "pandas.Timestamp.month_name SA01" \
245233
-i "pandas.Timestamp.nanosecond GL08" \
246234
-i "pandas.Timestamp.normalize SA01" \
247-
-i "pandas.Timestamp.now SA01" \
248235
-i "pandas.Timestamp.quarter SA01" \
249236
-i "pandas.Timestamp.replace PR07,SA01" \
250237
-i "pandas.Timestamp.resolution PR02" \
251238
-i "pandas.Timestamp.second GL08" \
252239
-i "pandas.Timestamp.strptime PR01,SA01" \
253-
-i "pandas.Timestamp.time SA01" \
254240
-i "pandas.Timestamp.timestamp SA01" \
255241
-i "pandas.Timestamp.timetuple SA01" \
256242
-i "pandas.Timestamp.timetz SA01" \
@@ -317,13 +303,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
317303
-i "pandas.api.types.is_period_dtype SA01" \
318304
-i "pandas.api.types.is_re PR07,SA01" \
319305
-i "pandas.api.types.is_re_compilable PR07,SA01" \
320-
-i "pandas.api.types.is_signed_integer_dtype SA01" \
321306
-i "pandas.api.types.is_sparse SA01" \
322-
-i "pandas.api.types.is_string_dtype SA01" \
323307
-i "pandas.api.types.is_timedelta64_ns_dtype SA01" \
324-
-i "pandas.api.types.is_unsigned_integer_dtype SA01" \
325308
-i "pandas.api.types.pandas_dtype PR07,RT03,SA01" \
326-
-i "pandas.api.types.union_categoricals RT03,SA01" \
327309
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
328310
-i "pandas.arrays.BooleanArray SA01" \
329311
-i "pandas.arrays.DatetimeArray SA01" \

ci/deps/actions-310-minimum_versions.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ dependencies:
1515
# test dependencies
1616
- pytest>=7.3.2
1717
- pytest-cov
18-
- pytest-xdist>=2.2.0
19-
- pytest-localserver>=0.7.1
20-
- pytest-qt>=4.2.0
18+
- pytest-xdist>=3.4.0
19+
- pytest-localserver>=0.8.1
20+
- pytest-qt>=4.4.0
2121
- boto3
2222

2323
# required dependencies
@@ -32,7 +32,7 @@ dependencies:
3232
- fastparquet=2023.10.0
3333
- fsspec=2022.11.0
3434
- html5lib=1.1
35-
- hypothesis=6.46.1
35+
- hypothesis=6.84.0
3636
- gcsfs=2022.11.0
3737
- jinja2=3.1.2
3838
- lxml=4.9.2

0 commit comments

Comments
 (0)