Skip to content

Series.shift with BDay is not allowed #1291

@loicdiridollou

Description

@loicdiridollou

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

sr = pd.Series(pd.bdate_range("2023-01-03", "2023-02-06"))
check(assert_type(sr.shift(BDay(1)), "TimestampSeries"), pd.Series, pd.Timestamp)

This will raise an issue as only DateOffset is allowed in the period parameter. The issue is that BDay does not inherit from DateOffset but directly from BaseOffset.

Is there a reason why we only allow DateOffset and not BaseOffset?

Happy to take care of the PR.

Please complete the following information:

  • OS: MacOS
  • OS Version 15.5
  • python version 3.13
  • version of type checker 1.17.0
  • version of installed pandas-stubs main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions