Skip to content

Commit 5d97ebf

Browse files
Merge remote-tracking branch 'upstream/2.3.x' into backport-60116
2 parents c307074 + fa7c87b commit 5d97ebf

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

.github/workflows/unit-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
TEST_ARGS: ${{ matrix.test_args || '' }}
118118
PYTEST_WORKERS: ${{ matrix.pytest_workers || 'auto' }}
119119
PYTEST_TARGET: ${{ matrix.pytest_target || 'pandas' }}
120-
NPY_PROMOTION_STATE: ${{ matrix.env_file == 'actions-311-numpydev.yaml' && 'weak' || 'legacy' }}
121120
# Clipboard tests
122121
QT_QPA_PLATFORM: offscreen
123122
REMOVE_PYARROW: ${{ matrix.name == 'Future infer strings (without pyarrow)' && '1' || '0' }}

.github/workflows/wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
151151

152152
- name: Build wheels
153-
uses: pypa/[email protected].0
153+
uses: pypa/[email protected].3
154154
with:
155155
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
156156
env:

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<2
21+
- numpy
2222
# pytz 2024.2 timezones cause wrong results
2323
- pytz<2024.2
2424
- pip

pandas/tests/io/test_parquet.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -993,16 +993,9 @@ def test_timestamp_nanoseconds(self, pa):
993993
df = pd.DataFrame({"a": pd.date_range("2017-01-01", freq="1ns", periods=10)})
994994
check_round_trip(df, pa, write_kwargs={"version": ver})
995995

996-
def test_timezone_aware_index(self, request, pa, timezone_aware_date_list):
996+
def test_timezone_aware_index(self, pa, timezone_aware_date_list):
997997
pytest.importorskip("pyarrow", "11.0.0")
998998

999-
if timezone_aware_date_list.tzinfo != datetime.timezone.utc:
1000-
request.applymarker(
1001-
pytest.mark.xfail(
1002-
reason="temporary skip this test until it is properly resolved: "
1003-
"https://github.com/pandas-dev/pandas/issues/37286"
1004-
)
1005-
)
1006999
idx = 5 * [timezone_aware_date_list]
10071000
df = pd.DataFrame(index=idx, data={"index_as_col": idx})
10081001

@@ -1015,7 +1008,23 @@ def test_timezone_aware_index(self, request, pa, timezone_aware_date_list):
10151008
# they both implement datetime.tzinfo
10161009
# they both wrap datetime.timedelta()
10171010
# this use-case sets the resolution to 1 minute
1018-
check_round_trip(df, pa, check_dtype=False)
1011+
1012+
expected = df[:]
1013+
if pa_version_under11p0:
1014+
expected.index = expected.index.as_unit("ns")
1015+
if timezone_aware_date_list.tzinfo != datetime.timezone.utc:
1016+
# pyarrow returns pytz.FixedOffset while pandas constructs datetime.timezone
1017+
# https://github.com/pandas-dev/pandas/issues/37286
1018+
try:
1019+
import pytz
1020+
except ImportError:
1021+
pass
1022+
else:
1023+
offset = df.index.tz.utcoffset(timezone_aware_date_list)
1024+
tz = pytz.FixedOffset(offset.total_seconds() / 60)
1025+
expected.index = expected.index.tz_convert(tz)
1026+
expected["index_as_col"] = expected["index_as_col"].dt.tz_convert(tz)
1027+
check_round_trip(df, pa, check_dtype=False, expected=expected)
10191028

10201029
def test_filter_row_groups(self, pa):
10211030
# https://github.com/pandas-dev/pandas/issues/26551

0 commit comments

Comments
 (0)