Skip to content

BUG: Series.str.split broken with pyarrow strings and regex argument #58321

Open
@WillAyd

Description

@WillAyd

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

In [70]: pd.Series(
    ...:     ["230/270/270", "240-290-290"],
    ...:     dtype="string[pyarrow]"
    ...: ).str.split(r"/|-", expand=True)
Out[70]: 
     0    1    2
0  230  270  270
1  240  290  290

In [71]: pd.Series(
    ...:     ["230/270/270", "240-290-290"],
    ...:     dtype=pd.ArrowDtype(pa.string())
    ...: ).str.split(r"/|-", expand=True)
Out[71]: 
             0
0  230/270/270
1  240-290-290

Issue Description

It doesn't look like arrow strings work when using a regular expression argument to split. I am also a bit confused why there is a difference between string[pyarrow] and pd.ArrowDtype(pa.string())

@phofl in case you know what's going on

Expected Behavior

Values should split for arrow string type

Installed Versions

In [73]: pd.version
Out[73]: '3.0.0.dev0+681.g434fda08cf'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Arrowpyarrow functionalityBugStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions