Skip to content

Commit 912afb3

Browse files
committed
Merge remote-tracking branch 'upstream/main' into wooseogchoi-59095
merged from upstream/main
2 parents 6d8fb41 + 236d89b commit 912afb3

File tree

178 files changed

+2276
-1946
lines changed

Some content is hidden

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

178 files changed

+2276
-1946
lines changed

.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/unit-tests.yml

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -148,9 +148,6 @@ jobs:
148148
uses: ./.github/actions/build_pandas
149149
# TODO: Re-enable once Pypy has Pypy 3.10 on conda-forge
150150
if: ${{ matrix.name != 'Pypy' }}
151-
with:
152-
meson_args: ${{ matrix.meson_args }}
153-
cflags_adds: ${{ matrix.cflags_adds }}
154151

155152
- name: Test (not single_cpu)
156153
uses: ./.github/actions/run-tests
@@ -302,7 +299,7 @@ jobs:
302299
# To freeze this file, uncomment out the ``if: false`` condition, and migrate the jobs
303300
# to the corresponding posix/windows-macos/sdist etc. workflows.
304301
# Feel free to modify this comment as necessary.
305-
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
306303
defaults:
307304
run:
308305
shell: bash -eou pipefail {0}
@@ -317,7 +314,7 @@ jobs:
317314

318315
concurrency:
319316
# https://github.community/t/concurrecy-not-work-for-push/183068/7
320-
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
321318
cancel-in-progress: true
322319

323320
env:
@@ -334,7 +331,7 @@ jobs:
334331
- name: Set up Python Dev Version
335332
uses: actions/setup-python@v5
336333
with:
337-
python-version: '3.12-dev'
334+
python-version: '3.13-dev'
338335

339336
- name: Build Environment
340337
run: |
@@ -349,6 +346,51 @@ jobs:
349346
- name: Run Tests
350347
uses: ./.github/actions/run-tests
351348

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.46.1 pytest>=7.3.2 pytest-xdist>=2.2.0 pytest-cov
386+
python -m pip install -ve . --no-build-isolation --no-index --no-deps --config-settings=setup-args="--werror"
387+
python -m pip list
388+
389+
- name: Run Tests
390+
uses: ./.github/actions/run-tests
391+
env:
392+
PYTHON_GIL: 0
393+
352394
emscripten:
353395
# Note: the Python version, Emscripten toolchain version are determined
354396
# by the Pyodide version. The appropriate versions can be found in the

.pre-commit-config.yaml

Lines changed: 4 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]
@@ -67,12 +67,13 @@ 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
7879
args: [--py310-plus]
@@ -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/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(

asv_bench/benchmarks/tslibs/timestamp.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
from datetime import datetime
1+
from datetime import (
2+
datetime,
3+
timezone,
4+
)
5+
import zoneinfo
26

37
import numpy as np
4-
import pytz
58

69
from pandas import Timestamp
710

@@ -12,7 +15,7 @@ class TimestampConstruction:
1215
def setup(self):
1316
self.npdatetime64 = np.datetime64("2020-01-01 00:00:00")
1417
self.dttime_unaware = datetime(2020, 1, 1, 0, 0, 0)
15-
self.dttime_aware = datetime(2020, 1, 1, 0, 0, 0, 0, pytz.UTC)
18+
self.dttime_aware = datetime(2020, 1, 1, 0, 0, 0, 0, timezone.utc)
1619
self.ts = Timestamp("2020-01-01 00:00:00")
1720

1821
def time_parse_iso8601_no_tz(self):
@@ -113,7 +116,7 @@ def setup(self, tz):
113116
self.ts = Timestamp("2017-08-25 08:16:14", tz=tz)
114117

115118
def time_replace_tz(self, tz):
116-
self.ts.replace(tzinfo=pytz.timezone("US/Eastern"))
119+
self.ts.replace(tzinfo=zoneinfo.ZoneInfo("US/Eastern"))
117120

118121
def time_replace_None(self, tz):
119122
self.ts.replace(tzinfo=None)
@@ -144,8 +147,8 @@ def time_ceil(self, tz):
144147

145148
class TimestampAcrossDst:
146149
def setup(self):
147-
dt = datetime(2016, 3, 27, 1)
148-
self.tzinfo = pytz.timezone("CET").localize(dt, is_dst=False).tzinfo
150+
dt = datetime(2016, 3, 27, 1, fold=0)
151+
self.tzinfo = dt.astimezone(zoneinfo.ZoneInfo("Europe/Berlin")).tzinfo
149152
self.ts2 = Timestamp(dt)
150153

151154
def time_replace_across_dst(self):

asv_bench/benchmarks/tslibs/tslib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
timedelta,
2121
timezone,
2222
)
23+
import zoneinfo
2324

2425
from dateutil.tz import (
2526
gettz,
2627
tzlocal,
2728
)
2829
import numpy as np
29-
import pytz
3030

3131
try:
3232
from pandas._libs.tslibs import ints_to_pydatetime
@@ -38,7 +38,7 @@
3838
None,
3939
timezone.utc,
4040
timezone(timedelta(minutes=60)),
41-
pytz.timezone("US/Pacific"),
41+
zoneinfo.ZoneInfo("US/Pacific"),
4242
gettz("Asia/Tokyo"),
4343
tzlocal_obj,
4444
]

asv_bench/benchmarks/tslibs/tz_convert.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from datetime import timezone
2+
13
import numpy as np
2-
from pytz import UTC
34

45
from pandas._libs.tslibs.tzconversion import tz_localize_to_utc
56

@@ -41,7 +42,7 @@ def time_tz_convert_from_utc(self, size, tz):
4142
# dti = DatetimeIndex(self.i8data, tz=tz)
4243
# dti.tz_localize(None)
4344
if old_sig:
44-
tz_convert_from_utc(self.i8data, UTC, tz)
45+
tz_convert_from_utc(self.i8data, timezone.utc, tz)
4546
else:
4647
tz_convert_from_utc(self.i8data, tz)
4748

ci/code_checks.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
162162
-i "pandas.Series.ne SA01" \
163163
-i "pandas.Series.pad PR01,SA01" \
164164
-i "pandas.Series.plot PR02" \
165-
-i "pandas.Series.pop RT03,SA01" \
165+
-i "pandas.Series.pop SA01" \
166166
-i "pandas.Series.prod RT03" \
167167
-i "pandas.Series.product RT03" \
168168
-i "pandas.Series.reorder_levels RT03,SA01" \
@@ -231,7 +231,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
231231
-i "pandas.Timestamp.ctime SA01" \
232232
-i "pandas.Timestamp.date SA01" \
233233
-i "pandas.Timestamp.day GL08" \
234-
-i "pandas.Timestamp.floor SA01" \
235234
-i "pandas.Timestamp.fold GL08" \
236235
-i "pandas.Timestamp.fromordinal SA01" \
237236
-i "pandas.Timestamp.fromtimestamp PR01,SA01" \
@@ -245,13 +244,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
245244
-i "pandas.Timestamp.month_name SA01" \
246245
-i "pandas.Timestamp.nanosecond GL08" \
247246
-i "pandas.Timestamp.normalize SA01" \
248-
-i "pandas.Timestamp.now SA01" \
249247
-i "pandas.Timestamp.quarter SA01" \
250248
-i "pandas.Timestamp.replace PR07,SA01" \
251249
-i "pandas.Timestamp.resolution PR02" \
252250
-i "pandas.Timestamp.second GL08" \
253251
-i "pandas.Timestamp.strptime PR01,SA01" \
254-
-i "pandas.Timestamp.time SA01" \
255252
-i "pandas.Timestamp.timestamp SA01" \
256253
-i "pandas.Timestamp.timetuple SA01" \
257254
-i "pandas.Timestamp.timetz SA01" \
@@ -261,7 +258,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
261258
-i "pandas.Timestamp.to_period PR01,SA01" \
262259
-i "pandas.Timestamp.today SA01" \
263260
-i "pandas.Timestamp.toordinal SA01" \
264-
-i "pandas.Timestamp.tz SA01" \
265261
-i "pandas.Timestamp.tz_localize SA01" \
266262
-i "pandas.Timestamp.tzinfo GL08" \
267263
-i "pandas.Timestamp.tzname SA01" \

ci/deps/actions-311-pyarrownightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818

1919
# required dependencies
2020
- python-dateutil
21-
- numpy
21+
- numpy<2
2222
- pytz
2323
- pip
2424

0 commit comments

Comments
 (0)