Skip to content

Commit 0929d9c

Browse files
authored
Merge branch 'main' into fix-49201
2 parents 2324567 + c121940 commit 0929d9c

File tree

395 files changed

+8650
-7478
lines changed

Some content is hidden

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

395 files changed

+8650
-7478
lines changed

.github/ISSUE_TEMPLATE/pdep_vote.yaml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: PDEP Vote
2+
description: Call for a vote on a PDEP
3+
title: "VOTE: "
4+
labels: [Vote]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: >
10+
As per [PDEP-1](https://pandas.pydata.org/pdeps/0001-purpose-and-guidelines.html), the following issue template should be used when a
11+
maintainer has opened a PDEP discussion and is ready to call for a vote.
12+
- type: checkboxes
13+
attributes:
14+
label: Locked issue
15+
options:
16+
- label: >
17+
I locked this voting issue so that only voting members are able to cast their votes or
18+
comment on this issue.
19+
required: true
20+
- type: input
21+
id: PDEP-name
22+
attributes:
23+
label: PDEP number and title
24+
placeholder: >
25+
PDEP-1: Purpose and guidelines
26+
validations:
27+
required: true
28+
- type: input
29+
id: PDEP-link
30+
attributes:
31+
label: Pull request with discussion
32+
description: e.g. https://github.com/pandas-dev/pandas/pull/47444
33+
validations:
34+
required: true
35+
- type: input
36+
id: PDEP-rendered-link
37+
attributes:
38+
label: Rendered PDEP for easy reading
39+
description: e.g. https://github.com/pandas-dev/pandas/pull/47444/files?short_path=7c449e6#diff-7c449e698132205b235c501f7e47ebba38da4d2b7f9492c98f16745dba787041
40+
validations:
41+
required: true
42+
- type: input
43+
id: PDEP-number-of-discussion-participants
44+
attributes:
45+
label: Discussion participants
46+
description: >
47+
You may find it useful to list or total the number of participating members in the
48+
PDEP discussion PR. This would be the maximum possible disapprove votes.
49+
placeholder: >
50+
14 voting members participated in the PR discussion thus far.
51+
- type: input
52+
id: PDEP-vote-end
53+
attributes:
54+
label: Voting will close in 15 days.
55+
description: The voting period end date. ('Voting will close in 15 days.' will be automatically written)
56+
- type: markdown
57+
attributes:
58+
value: ---
59+
- type: textarea
60+
id: Vote
61+
attributes:
62+
label: Vote
63+
value: |
64+
Cast your vote in a comment below.
65+
* +1: approve.
66+
* 0: abstain.
67+
* Reason: A one sentence reason is required.
68+
* -1: disapprove
69+
* Reason: A one sentence reason is required.
70+
A disapprove vote requires prior participation in the linked discussion PR.
71+
72+
@pandas-dev/pandas-core
73+
validations:
74+
required: true

.github/workflows/code-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
8686
if: ${{ steps.build.outcome == 'success' && always() }}
8787

88-
- name: Typing + pylint
88+
- name: Typing
8989
uses: pre-commit/[email protected]
9090
with:
9191
extra_args: --verbose --hook-stage manual --all-files

.github/workflows/unit-tests.yml

+60-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ jobs:
314314
timeout-minutes: 90
315315

316316
concurrency:
317-
#https://github.community/t/concurrecy-not-work-for-push/183068/7
317+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
318318
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.os }}-${{ matrix.pytest_target }}-dev
319319
cancel-in-progress: true
320320

@@ -346,3 +346,62 @@ jobs:
346346
347347
- name: Run Tests
348348
uses: ./.github/actions/run-tests
349+
350+
emscripten:
351+
# Note: the Python version, Emscripten toolchain version are determined
352+
# by the Pyodide version. The appropriate versions can be found in the
353+
# Pyodide repodata.json "info" field, or in the Makefile.envs file:
354+
# https://github.com/pyodide/pyodide/blob/stable/Makefile.envs#L2
355+
# The Node.js version can be determined via Pyodide:
356+
# https://pyodide.org/en/stable/usage/index.html#node-js
357+
name: Pyodide build
358+
runs-on: ubuntu-22.04
359+
concurrency:
360+
# https://github.community/t/concurrecy-not-work-for-push/183068/7
361+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-wasm
362+
cancel-in-progress: true
363+
steps:
364+
- name: Checkout pandas Repo
365+
uses: actions/checkout@v4
366+
with:
367+
fetch-depth: 0
368+
369+
- name: Set up Python for Pyodide
370+
id: setup-python
371+
uses: actions/setup-python@v5
372+
with:
373+
python-version: '3.11.3'
374+
375+
- name: Set up Emscripten toolchain
376+
uses: mymindstorm/setup-emsdk@v14
377+
with:
378+
version: '3.1.46'
379+
actions-cache-folder: emsdk-cache
380+
381+
- name: Install pyodide-build
382+
run: pip install "pyodide-build==0.25.1"
383+
384+
- name: Build pandas for Pyodide
385+
run: |
386+
pyodide build
387+
388+
- name: Set up Node.js
389+
uses: actions/setup-node@v4
390+
with:
391+
node-version: '18'
392+
393+
- name: Set up Pyodide virtual environment
394+
run: |
395+
pyodide venv .venv-pyodide
396+
source .venv-pyodide/bin/activate
397+
pip install dist/*.whl
398+
399+
- name: Test pandas for Pyodide
400+
env:
401+
PANDAS_CI: 1
402+
run: |
403+
source .venv-pyodide/bin/activate
404+
pip install pytest hypothesis
405+
# do not import pandas from the checked out repo
406+
cd ..
407+
python -c 'import pandas as pd; pd.test(extra_args=["-m not clipboard and not single_cpu and not slow and not network and not db"])'

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
141141

142142
- name: Build wheels
143-
uses: pypa/cibuildwheel@v2.17.0
143+
uses: pypa/cibuildwheel@v2.18.0
144144
with:
145145
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
146146
env:

.pre-commit-config.yaml

+7-31
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ ci:
1616
autofix_prs: false
1717
autoupdate_schedule: monthly
1818
# manual stage hooks
19-
skip: [pylint, pyright, mypy]
19+
skip: [pyright, mypy]
2020
repos:
2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: v0.3.4
22+
rev: v0.4.3
2323
hooks:
2424
- id: ruff
2525
args: [--exit-non-zero-on-fix]
@@ -30,12 +30,6 @@ repos:
3030
files: ^pandas
3131
exclude: ^pandas/tests
3232
args: [--select, "ANN001,ANN2", --fix-only, --exit-non-zero-on-fix]
33-
- id: ruff
34-
name: ruff-use-pd_array-in-core
35-
alias: ruff-use-pd_array-in-core
36-
files: ^pandas/core/
37-
exclude: ^pandas/core/api\.py$
38-
args: [--select, "ICN001", --exit-non-zero-on-fix]
3933
- id: ruff-format
4034
exclude: ^scripts
4135
- repo: https://github.com/jendrikseipp/vulture
@@ -52,12 +46,12 @@ repos:
5246
types_or: [python, rst, markdown, cython, c]
5347
additional_dependencies: [tomli]
5448
- repo: https://github.com/MarcoGorelli/cython-lint
55-
rev: v0.16.0
49+
rev: v0.16.2
5650
hooks:
5751
- id: cython-lint
5852
- id: double-quote-cython-strings
5953
- repo: https://github.com/pre-commit/pre-commit-hooks
60-
rev: v4.5.0
54+
rev: v4.6.0
6155
hooks:
6256
- id: check-case-conflict
6357
- id: check-toml
@@ -73,25 +67,6 @@ repos:
7367
- id: fix-encoding-pragma
7468
args: [--remove]
7569
- id: trailing-whitespace
76-
- repo: https://github.com/pylint-dev/pylint
77-
rev: v3.0.1
78-
hooks:
79-
- id: pylint
80-
stages: [manual]
81-
args: [--load-plugins=pylint.extensions.redefined_loop_name, --fail-on=I0021]
82-
- id: pylint
83-
alias: redefined-outer-name
84-
name: Redefining name from outer scope
85-
files: ^pandas/
86-
exclude: |
87-
(?x)
88-
^pandas/tests # keep excluded
89-
|/_testing/ # keep excluded
90-
|^pandas/util/_test_decorators\.py # keep excluded
91-
|^pandas/_version\.py # keep excluded
92-
|^pandas/conftest\.py # keep excluded
93-
args: [--disable=all, --enable=redefined-outer-name]
94-
stages: [manual]
9570
- repo: https://github.com/PyCQA/isort
9671
rev: 5.13.2
9772
hooks:
@@ -115,8 +90,9 @@ repos:
11590
rev: v0.9.1
11691
hooks:
11792
- id: sphinx-lint
93+
args: ["--enable", "all", "--disable", "line-too-long"]
11894
- repo: https://github.com/pre-commit/mirrors-clang-format
119-
rev: v18.1.2
95+
rev: v18.1.4
12096
hooks:
12197
- id: clang-format
12298
files: ^pandas/_libs/src|^pandas/_libs/include
@@ -133,7 +109,7 @@ repos:
133109
types: [python]
134110
stages: [manual]
135111
additional_dependencies: &pyright_dependencies
136-
112+
137113
- id: pyright
138114
# note: assumes python env is setup and activated
139115
name: pyright reportGeneralTypeIssues

asv_bench/asv.conf.json

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
// pip (with all the conda available packages installed first,
4242
// followed by the pip installed packages).
4343
"matrix": {
44+
"pip+build": [],
4445
"Cython": ["3.0"],
4546
"matplotlib": [],
4647
"sqlalchemy": [],

asv_bench/benchmarks/frame_methods.py

+24
Original file line numberDiff line numberDiff line change
@@ -862,4 +862,28 @@ def time_last_valid_index(self, dtype):
862862
self.df.last_valid_index()
863863

864864

865+
class Update:
866+
def setup(self):
867+
rng = np.random.default_rng()
868+
self.df = DataFrame(rng.uniform(size=(1_000_000, 10)))
869+
870+
idx = rng.choice(range(1_000_000), size=1_000_000, replace=False)
871+
self.df_random = DataFrame(self.df, index=idx)
872+
873+
idx = rng.choice(range(1_000_000), size=100_000, replace=False)
874+
cols = rng.choice(range(10), size=2, replace=False)
875+
self.df_sample = DataFrame(
876+
rng.uniform(size=(100_000, 2)), index=idx, columns=cols
877+
)
878+
879+
def time_to_update_big_frame_small_arg(self):
880+
self.df.update(self.df_sample)
881+
882+
def time_to_update_random_indices(self):
883+
self.df_random.update(self.df_sample)
884+
885+
def time_to_update_small_frame_big_arg(self):
886+
self.df_sample.update(self.df)
887+
888+
865889
from .pandas_vb_common import setup # noqa: F401 isort:skip

asv_bench/benchmarks/io/csv.py

-10
Original file line numberDiff line numberDiff line change
@@ -445,16 +445,6 @@ def setup(self, engine):
445445
data = data.format(*two_cols)
446446
self.StringIO_input = StringIO(data)
447447

448-
def time_multiple_date(self, engine):
449-
read_csv(
450-
self.data(self.StringIO_input),
451-
engine=engine,
452-
sep=",",
453-
header=None,
454-
names=list(string.digits[:9]),
455-
parse_dates=[[1, 2], [1, 3]],
456-
)
457-
458448
def time_baseline(self, engine):
459449
read_csv(
460450
self.data(self.StringIO_input),

asv_bench/benchmarks/io/parsers.py

+1-24
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import numpy as np
2-
31
try:
4-
from pandas._libs.tslibs.parsing import (
5-
_does_string_look_like_datetime,
6-
concat_date_cols,
7-
)
2+
from pandas._libs.tslibs.parsing import _does_string_look_like_datetime
83
except ImportError:
94
# Avoid whole benchmark suite import failure on asv (currently 0.4)
105
pass
@@ -20,21 +15,3 @@ def setup(self, value):
2015
def time_check_datetimes(self, value):
2116
for obj in self.objects:
2217
_does_string_look_like_datetime(obj)
23-
24-
25-
class ConcatDateCols:
26-
params = ([1234567890, "AAAA"], [1, 2])
27-
param_names = ["value", "dim"]
28-
29-
def setup(self, value, dim):
30-
count_elem = 10000
31-
if dim == 1:
32-
self.object = (np.array([value] * count_elem),)
33-
if dim == 2:
34-
self.object = (
35-
np.array([value] * count_elem),
36-
np.array([value] * count_elem),
37-
)
38-
39-
def time_check_concat(self, value, dim):
40-
concat_date_cols(self.object)

asv_bench/benchmarks/series_methods.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,14 @@ def time_searchsorted(self, dtype):
148148

149149

150150
class Map:
151-
params = (["dict", "Series", "lambda"], ["object", "category", "int"])
152-
param_names = "mapper"
153-
154-
def setup(self, mapper, dtype):
151+
params = (
152+
["dict", "Series", "lambda"],
153+
["object", "category", "int"],
154+
[None, "ignore"],
155+
)
156+
param_names = ["mapper", "dtype", "na_action"]
157+
158+
def setup(self, mapper, dtype, na_action):
155159
map_size = 1000
156160
map_data = Series(map_size - np.arange(map_size), dtype=dtype)
157161

@@ -168,8 +172,8 @@ def setup(self, mapper, dtype):
168172

169173
self.s = Series(np.random.randint(0, map_size, 10000), dtype=dtype)
170174

171-
def time_map(self, mapper, *args, **kwargs):
172-
self.s.map(self.map_data)
175+
def time_map(self, mapper, dtype, na_action):
176+
self.s.map(self.map_data, na_action=na_action)
173177

174178

175179
class Clip:

0 commit comments

Comments
 (0)