Skip to content

Incorrect signature for pandas.Series.str.rsplit #1032

Closed
@kroche98

Description

@kroche98

Describe the bug
The stubs for pandas_stubs.core.strings.StringMethods.rsplit includes a regex: bool parameter. The function pandas.Series.str.rsplit contains no such parameter.

To Reproduce


ser = pd.Series(["foo.bar.baz", "qux.foobar"])
ser.str.rsplit(".", regex=False)

I'm using pyright, which does not raise any error, even though it should since actually running the code results in TypeError: StringMethods.rsplit() got an unexpected keyword argument 'regex'.
Please complete the following information:

  • OS: MacOS
  • OS Version: Sonoma 14.6.1
  • Python 3.12.1
  • pyright 1.1.389
  • pandas-stubs 2.2.3.241009

Additional context
The confusion seems to stem from the fact that the parallel method pandas.Series.str.split does include a regex: bool parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions