Skip to content

Commit 786d256

Browse files
authored
Merge branch 'main' into fix-dtype_backend-doc
2 parents 64f17d5 + bef88ef commit 786d256

File tree

114 files changed

+886
-853
lines changed

Some content is hidden

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

114 files changed

+886
-853
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: 8 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: |

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 & 3 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" \
@@ -261,7 +260,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
261260
-i "pandas.Timestamp.to_period PR01,SA01" \
262261
-i "pandas.Timestamp.today SA01" \
263262
-i "pandas.Timestamp.toordinal SA01" \
264-
-i "pandas.Timestamp.tz SA01" \
265263
-i "pandas.Timestamp.tz_localize SA01" \
266264
-i "pandas.Timestamp.tzinfo GL08" \
267265
-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

doc/source/user_guide/io.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4990,7 +4990,7 @@ Caveats
49904990
convenience you can use ``store.flush(fsync=True)`` to do this for you.
49914991
* Once a ``table`` is created columns (DataFrame)
49924992
are fixed; only exactly the same columns can be appended
4993-
* Be aware that timezones (e.g., ``pytz.timezone('US/Eastern')``)
4993+
* Be aware that timezones (e.g., ``zoneinfo.ZoneInfo('US/Eastern')``)
49944994
are not necessarily equal across timezone versions. So if data is
49954995
localized to a specific timezone in the HDFStore using one version
49964996
of a timezone library and that data is updated with another version, the data
@@ -5169,6 +5169,8 @@ See the `Full Documentation <https://github.com/wesm/feather>`__.
51695169

51705170
.. ipython:: python
51715171
5172+
import pytz
5173+
51725174
df = pd.DataFrame(
51735175
{
51745176
"a": list("abc"),
@@ -5178,7 +5180,7 @@ See the `Full Documentation <https://github.com/wesm/feather>`__.
51785180
"e": [True, False, True],
51795181
"f": pd.Categorical(list("abc")),
51805182
"g": pd.date_range("20130101", periods=3),
5181-
"h": pd.date_range("20130101", periods=3, tz="US/Eastern"),
5183+
"h": pd.date_range("20130101", periods=3, tz=pytz.timezone("US/Eastern")),
51825184
"i": pd.date_range("20130101", periods=3, freq="ns"),
51835185
}
51845186
)

0 commit comments

Comments
 (0)