Skip to content

Commit 3cb85ce

Browse files
DOC: Fix GL08 for pandas.tseries.offsets.FY5253Quarter.is_on_offset (#63947)
1 parent e636b0b commit 3cb85ce

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7171
--format=actions \
7272
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
7373
-i "pandas.tseries.offsets.CustomBusinessHour PR02,SA01" \
74-
-i "pandas.tseries.offsets.FY5253Quarter.is_on_offset GL08" \
7574
-i "pandas.tseries.offsets.LastWeekOfMonth.is_on_offset GL08" \
7675
-i "pandas.tseries.offsets.SemiMonthBegin.rule_code GL08" \
7776
-i "pandas.tseries.offsets.SemiMonthEnd.rule_code GL08" \

pandas/_libs/tslibs/offsets.pyx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6004,6 +6004,40 @@ cdef class FY5253Quarter(FY5253Mixin):
60046004
return weeks_in_year == 53
60056005

60066006
def is_on_offset(self, dt: datetime) -> bool:
6007+
"""
6008+
Return boolean whether a timestamp intersects with this frequency.
6009+
6010+
This method checks if a given datetime falls on a fiscal quarter end date
6011+
as defined by the 52-53 week fiscal year calendar.
6012+
6013+
Parameters
6014+
----------
6015+
dt : datetime
6016+
Timestamp to check.
6017+
6018+
Returns
6019+
-------
6020+
bool
6021+
True if the timestamp is on a fiscal quarter end, False otherwise.
6022+
6023+
See Also
6024+
--------
6025+
FY5253.is_on_offset : Check if timestamp is on fiscal year end.
6026+
DateOffset.is_on_offset : Check if timestamp intersects with frequency.
6027+
6028+
Examples
6029+
--------
6030+
>>> offset = pd.offsets.FY5253Quarter(
6031+
... weekday=4, startingMonth=12, variation="last"
6032+
... )
6033+
>>> ts = pd.Timestamp(2022, 4, 1)
6034+
>>> offset.is_on_offset(ts)
6035+
True
6036+
6037+
>>> ts = pd.Timestamp(2022, 4, 3)
6038+
>>> offset.is_on_offset(ts)
6039+
False
6040+
"""
60076041
if self.normalize and not _is_normalized(dt):
60086042
return False
60096043
if self._offset.is_on_offset(dt):

0 commit comments

Comments
 (0)