From be8f61bdff6a0b5062ec6d5ad432ea261d22b522 Mon Sep 17 00:00:00 2001 From: Sebastian Goldmann Date: Sat, 25 Oct 2025 22:04:21 +0200 Subject: [PATCH 1/4] Improved docstring offset class BusinessDay --- pandas/_libs/tslibs/offsets.pyx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index ad3fb72d31559..0c3c4db9fc8ee 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1899,6 +1899,9 @@ cdef class BusinessDay(BusinessMixin): """ DateOffset subclass representing possibly n business days. + This offset is commonly used in financial and business contexts where weekends + and holidays are excluded from date calculations. + Parameters ---------- n : int, default 1 @@ -1908,6 +1911,16 @@ cdef class BusinessDay(BusinessMixin): offset : timedelta, default timedelta(0) Time offset to apply. + Returns + ------- + BusinessDay + A business day offset instance. + + See Also + -------- + CustomBusinessDay : A business day offset with custom holidays and weekmask. + DateOffset : The base class for all time-based offsets. + Examples -------- You can use the parameter ``n`` to represent a shift of n business days. @@ -1925,6 +1938,7 @@ cdef class BusinessDay(BusinessMixin): >>> ts + pd.offsets.BusinessDay(normalize=True) Timestamp('2022-12-12 00:00:00') """ + _period_dtype_code = PeriodDtypeCode.B _prefix = "B" _attributes = tuple(["n", "normalize", "offset"]) From ad2945dfef2315984cb224bcc2bf1e4462d24e66 Mon Sep 17 00:00:00 2001 From: Sebastian Goldmann Date: Sun, 26 Oct 2025 18:23:38 +0100 Subject: [PATCH 2/4] removed whitespace in docstring --- pandas/_libs/tslibs/offsets.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 0c3c4db9fc8ee..5589427bda02f 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1900,7 +1900,7 @@ cdef class BusinessDay(BusinessMixin): DateOffset subclass representing possibly n business days. This offset is commonly used in financial and business contexts where weekends - and holidays are excluded from date calculations. + and holidays are excluded from date calculations. Parameters ---------- @@ -1938,7 +1938,6 @@ cdef class BusinessDay(BusinessMixin): >>> ts + pd.offsets.BusinessDay(normalize=True) Timestamp('2022-12-12 00:00:00') """ - _period_dtype_code = PeriodDtypeCode.B _prefix = "B" _attributes = tuple(["n", "normalize", "offset"]) From b4057679fdbfda9743c19ba065e5f2ff46bc5868 Mon Sep 17 00:00:00 2001 From: Sebastian Goldmann Date: Sun, 26 Oct 2025 19:33:02 +0100 Subject: [PATCH 3/4] removed fixed docstring from CI code checks --- ci/code_checks.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 3b1af77e5f70e..0060819a92895 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -79,7 +79,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.api.typing.SeriesGroupBy.plot PR02" \ -i "pandas.api.typing.Resampler.quantile PR01,PR07" \ -i "pandas.arrays.NumpyExtensionArray GL08" \ - -i "pandas.tseries.offsets.BDay PR02,SA01" \ -i "pandas.tseries.offsets.BHalfYearBegin.is_on_offset GL08" \ -i "pandas.tseries.offsets.BHalfYearBegin.n GL08" \ -i "pandas.tseries.offsets.BHalfYearBegin.normalize GL08" \ @@ -108,7 +107,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.tseries.offsets.BYearEnd.month GL08" \ -i "pandas.tseries.offsets.BYearEnd.n GL08" \ -i "pandas.tseries.offsets.BYearEnd.normalize GL08" \ - -i "pandas.tseries.offsets.BusinessDay PR02,SA01" \ -i "pandas.tseries.offsets.BusinessDay.calendar GL08" \ -i "pandas.tseries.offsets.BusinessDay.holidays GL08" \ -i "pandas.tseries.offsets.BusinessDay.is_on_offset GL08" \ From 65ae456fce3d3e245741fae3764e9ddc54163e1f Mon Sep 17 00:00:00 2001 From: Sebastian Goldmann Date: Tue, 28 Oct 2025 20:52:09 +0100 Subject: [PATCH 4/4] reverted deletion CI code_check PR02 on cython class --- ci/code_checks.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 0060819a92895..b30a07d20105e 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -79,6 +79,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.api.typing.SeriesGroupBy.plot PR02" \ -i "pandas.api.typing.Resampler.quantile PR01,PR07" \ -i "pandas.arrays.NumpyExtensionArray GL08" \ + -i "pandas.tseries.offsets.BDay PR02" \ -i "pandas.tseries.offsets.BHalfYearBegin.is_on_offset GL08" \ -i "pandas.tseries.offsets.BHalfYearBegin.n GL08" \ -i "pandas.tseries.offsets.BHalfYearBegin.normalize GL08" \ @@ -107,6 +108,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.tseries.offsets.BYearEnd.month GL08" \ -i "pandas.tseries.offsets.BYearEnd.n GL08" \ -i "pandas.tseries.offsets.BYearEnd.normalize GL08" \ + -i "pandas.tseries.offsets.BusinessDay PR02" \ -i "pandas.tseries.offsets.BusinessDay.calendar GL08" \ -i "pandas.tseries.offsets.BusinessDay.holidays GL08" \ -i "pandas.tseries.offsets.BusinessDay.is_on_offset GL08" \