Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
-i "pandas.tseries.offsets.BusinessHour PR02,SA01" \
-i "pandas.tseries.offsets.CustomBusinessHour PR02,SA01" \
-i "pandas.tseries.offsets.FY5253Quarter.is_on_offset GL08" \
-i "pandas.tseries.offsets.LastWeekOfMonth.is_on_offset GL08" \
-i "pandas.tseries.offsets.SemiMonthBegin.rule_code GL08" \
-i "pandas.tseries.offsets.SemiMonthEnd.rule_code GL08" \
Expand Down
34 changes: 34 additions & 0 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5992,6 +5992,40 @@ cdef class FY5253Quarter(FY5253Mixin):
return weeks_in_year == 53

def is_on_offset(self, dt: datetime) -> bool:
"""
Return boolean whether a timestamp intersects with this frequency.

This method checks if a given datetime falls on a fiscal quarter end date
as defined by the 52-53 week fiscal year calendar.

Parameters
----------
dt : datetime
Timestamp to check.

Returns
-------
bool
True if the timestamp is on a fiscal quarter end, False otherwise.

See Also
--------
FY5253.is_on_offset : Check if timestamp is on fiscal year end.
DateOffset.is_on_offset : Check if timestamp intersects with frequency.

Examples
--------
>>> offset = pd.offsets.FY5253Quarter(
... weekday=4, startingMonth=12, variation="last"
... )
>>> ts = pd.Timestamp(2022, 4, 1)
>>> offset.is_on_offset(ts)
True

>>> ts = pd.Timestamp(2022, 4, 3)
>>> offset.is_on_offset(ts)
False
"""
if self.normalize and not _is_normalized(dt):
return False
if self._offset.is_on_offset(dt):
Expand Down
Loading