Skip to content

Commit 156219e

Browse files
authored
Merge branch 'main' into fix-zip-strict-indexing
2 parents a7176a1 + 98ffe4c commit 156219e

File tree

10 files changed

+40
-61
lines changed

10 files changed

+40
-61
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8181
-i "pandas.tseries.offsets.CustomBusinessMonthBegin PR02" \
8282
-i "pandas.tseries.offsets.CustomBusinessMonthEnd PR02" \
8383
-i "pandas.tseries.offsets.Easter.is_on_offset GL08" \
84-
-i "pandas.tseries.offsets.FY5253.is_on_offset GL08" \
8584
-i "pandas.tseries.offsets.FY5253Quarter.is_on_offset GL08" \
8685
-i "pandas.tseries.offsets.FY5253Quarter.rule_code GL08" \
8786
-i "pandas.tseries.offsets.LastWeekOfMonth.is_on_offset GL08" \

ci/deps/actions-311.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- pyqt>=5.15.9
4343
- openpyxl>=3.1.5
4444
- psycopg2>=2.9.10
45-
- pyarrow>=13.0.0
45+
- pyarrow>=13.0.0,<=22.0.0 # https://github.com/apache/arrow/issues/49003
4646
- pyiceberg>=0.8.1
4747
- pydantic<2.12.0 # TMP pin to avoid pyiceberg/pydantic issues
4848
- pymysql>=1.1.1

ci/deps/actions-312.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dependencies:
4242
- pyqt>=5.15.9
4343
- openpyxl>=3.1.5
4444
- psycopg2>=2.9.10
45-
- pyarrow>=13.0.0
45+
- pyarrow>=13.0.0,<=22.0.0 # https://github.com/apache/arrow/issues/49003
4646
- pyiceberg>=0.8.1
4747
- pydantic<2.12.0 # TMP pin to avoid pyiceberg/pydantic issues
4848
- pymysql>=1.1.1

ci/deps/actions-313-downstream_compat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ dependencies:
4141
- qtpy>=2.4.2
4242
- openpyxl>=3.1.5
4343
- psycopg2>=2.9.10
44-
- pyarrow>=13.0.0
44+
- pyarrow>=13.0.0,<=22.0.0 # https://github.com/apache/arrow/issues/49003
4545
- pyiceberg>=0.8.1
4646
- pymysql>=1.1.1
4747
- pyqt>=5.15.9

ci/deps/actions-313.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies:
4343
- pyqt>=5.15.9
4444
- openpyxl>=3.1.5
4545
- psycopg2>=2.9.10
46-
- pyarrow>=13.0.0
46+
- pyarrow>=13.0.0,<=22.0.0 # https://github.com/apache/arrow/issues/49003
4747
- pymysql>=1.1.1
4848
- pyreadstat>=1.2.8
4949
- pytables>=3.10.1

pandas/_libs/tslibs/offsets.pyx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5328,6 +5328,38 @@ cdef class FY5253(FY5253Mixin):
53285328
_attributes = tuple(["n", "normalize", "weekday", "startingMonth", "variation"])
53295329

53305330
def is_on_offset(self, dt: datetime) -> bool:
5331+
"""
5332+
Return boolean whether a timestamp intersects with this frequency.
5333+
5334+
This method checks if a given datetime falls on a fiscal year end date
5335+
as defined by the 52-53 week fiscal year calendar.
5336+
5337+
Parameters
5338+
----------
5339+
dt : datetime
5340+
Timestamp to check.
5341+
5342+
Returns
5343+
-------
5344+
bool
5345+
True if the timestamp is on the fiscal year end, False otherwise.
5346+
5347+
See Also
5348+
--------
5349+
FY5253Quarter.is_on_offset : Check if timestamp is on fiscal quarter end.
5350+
DateOffset.is_on_offset : Check if timestamp intersects with frequency.
5351+
5352+
Examples
5353+
--------
5354+
>>> offset = pd.offsets.FY5253(weekday=4, startingMonth=12, variation="last")
5355+
>>> ts = pd.Timestamp(2022, 12, 30)
5356+
>>> offset.is_on_offset(ts)
5357+
True
5358+
5359+
>>> ts = pd.Timestamp(2022, 12, 31)
5360+
>>> offset.is_on_offset(ts)
5361+
False
5362+
"""
53315363
if self.normalize and not _is_normalized(dt):
53325364
return False
53335365
dt = datetime(dt.year, dt.month, dt.day)

pandas/core/dtypes/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ def is_string_dtype(arr_or_dtype) -> bool:
627627
628628
See Also
629629
--------
630-
api.types.is_string_dtype : Check whether the provided array or dtype
631-
is of the string dtype.
630+
api.types.is_object_dtype : Check whether an array-like or dtype is of the
631+
object dtype.
632632
633633
Examples
634634
--------

pandas/tests/extension/test_arrow.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
from pandas._libs.tslibs import timezones
3737
from pandas.compat import (
3838
PY312,
39-
is_ci_environment,
40-
is_platform_windows,
4139
pa_version_under14p0,
4240
pa_version_under19p0,
4341
pa_version_under20p0,
@@ -72,18 +70,6 @@
7270
from pandas.core.arrays.arrow.extension_types import ArrowPeriodType
7371

7472

75-
def _require_timezone_database(request):
76-
if is_platform_windows() and is_ci_environment():
77-
mark = pytest.mark.xfail(
78-
raises=pa.ArrowInvalid,
79-
reason=(
80-
"TODO: Set ARROW_TIMEZONE_DATABASE environment variable "
81-
"on CI to path to the tzdata for pyarrow."
82-
),
83-
)
84-
request.applymarker(mark)
85-
86-
8773
@pytest.fixture(params=tm.ALL_PYARROW_DTYPES, ids=str)
8874
def dtype(request):
8975
return ArrowDtype(pyarrow_dtype=request.param)
@@ -363,10 +349,6 @@ def test_from_sequence_pa_array_notimplemented(self, request):
363349
ArrowExtensionArray._from_sequence_of_strings(["12-1"], dtype=dtype)
364350

365351
def test_from_sequence_of_strings_pa_array(self, data, request):
366-
pa_dtype = data.dtype.pyarrow_dtype
367-
if pa.types.is_timestamp(pa_dtype) and pa_dtype.tz is not None:
368-
_require_timezone_database(request)
369-
370352
pa_array = data._pa_array.cast(pa.string())
371353
result = type(data)._from_sequence_of_strings(pa_array, dtype=data.dtype)
372354
tm.assert_extension_array_equal(result, data)
@@ -2608,17 +2590,13 @@ def test_dt_isocalendar():
26082590
)
26092591
def test_dt_day_month_name(method, exp, request):
26102592
# GH 52388
2611-
_require_timezone_database(request)
2612-
26132593
ser = pd.Series([datetime(2023, 1, 1), None], dtype=ArrowDtype(pa.timestamp("ms")))
26142594
result = getattr(ser.dt, method)()
26152595
expected = pd.Series([exp, None], dtype=ArrowDtype(pa.string()))
26162596
tm.assert_series_equal(result, expected)
26172597

26182598

26192599
def test_dt_strftime(request):
2620-
_require_timezone_database(request)
2621-
26222600
ser = pd.Series(
26232601
[datetime(year=2023, month=1, day=2, hour=3), None],
26242602
dtype=ArrowDtype(pa.timestamp("ns")),
@@ -2705,8 +2683,6 @@ def test_dt_tz_localize_unsupported_tz_options():
27052683

27062684

27072685
def test_dt_tz_localize_none(request):
2708-
_require_timezone_database(request)
2709-
27102686
ser = pd.Series(
27112687
[datetime(year=2023, month=1, day=2, hour=3), None],
27122688
dtype=ArrowDtype(pa.timestamp("ns", tz="US/Pacific")),
@@ -2721,8 +2697,6 @@ def test_dt_tz_localize_none(request):
27212697

27222698
@pytest.mark.parametrize("unit", ["us", "ns"])
27232699
def test_dt_tz_localize(unit, request):
2724-
_require_timezone_database(request)
2725-
27262700
ser = pd.Series(
27272701
[datetime(year=2023, month=1, day=2, hour=3), None],
27282702
dtype=ArrowDtype(pa.timestamp(unit)),
@@ -2744,8 +2718,6 @@ def test_dt_tz_localize(unit, request):
27442718
],
27452719
)
27462720
def test_dt_tz_localize_nonexistent(nonexistent, exp_date, request):
2747-
_require_timezone_database(request)
2748-
27492721
ser = pd.Series(
27502722
[datetime(year=2023, month=3, day=12, hour=2, minute=30), None],
27512723
dtype=ArrowDtype(pa.timestamp("ns")),

pandas/tests/interchange/test_impl.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
import pytest
88

99
from pandas._libs.tslibs import iNaT
10-
from pandas.compat import (
11-
is_ci_environment,
12-
is_platform_windows,
13-
)
1410

1511
import pandas as pd
1612
import pandas._testing as tm
@@ -380,21 +376,11 @@ def test_datetimetzdtype(tz, unit):
380376
tm.assert_frame_equal(df, from_dataframe(df.__dataframe__()))
381377

382378

383-
def test_interchange_from_non_pandas_tz_aware(request):
379+
def test_interchange_from_non_pandas_tz_aware():
384380
# GH 54239, 54287
385381
pa = pytest.importorskip("pyarrow", "11.0.0")
386382
import pyarrow.compute as pc
387383

388-
if is_platform_windows() and is_ci_environment():
389-
mark = pytest.mark.xfail(
390-
raises=pa.ArrowInvalid,
391-
reason=(
392-
"TODO: Set ARROW_TIMEZONE_DATABASE environment variable "
393-
"on CI to path to the tzdata for pyarrow."
394-
),
395-
)
396-
request.applymarker(mark)
397-
398384
arr = pa.array([datetime(2020, 1, 1), None, datetime(2020, 1, 2)])
399385
arr = pc.assume_timezone(arr, "Asia/Kathmandu")
400386
table = pa.table({"arr": arr})

pandas/tests/resample/test_datetime_index.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from pandas._libs import lib
99
from pandas._libs.tslibs import Day
1010
from pandas._typing import DatetimeNaTType
11-
from pandas.compat import is_platform_windows
1211
from pandas.errors import Pandas4Warning
1312
import pandas.util._test_decorators as td
1413

@@ -2138,16 +2137,7 @@ def test_resample_b_55282(unit):
21382137
@td.skip_if_no("pyarrow")
21392138
@pytest.mark.parametrize(
21402139
"tz",
2141-
[
2142-
None,
2143-
pytest.param(
2144-
"UTC",
2145-
marks=pytest.mark.xfail(
2146-
condition=is_platform_windows(),
2147-
reason="TODO: Set ARROW_TIMEZONE_DATABASE env var in CI",
2148-
),
2149-
),
2150-
],
2140+
[None, "UTC"],
21512141
)
21522142
def test_arrow_timestamp_resample(tz):
21532143
# GH 56371

0 commit comments

Comments
 (0)