You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "IonK (Jira)" <ji...@apache.org> on 2023/03/10 18:06:00 UTC

[jira] [Created] (SPARK-42751) Pyspark.pandas.series.str.findall can't handle tuples that are returned by regex

IonK created SPARK-42751:
----------------------------

             Summary: Pyspark.pandas.series.str.findall can't handle tuples that are returned by regex
                 Key: SPARK-42751
                 URL: https://issues.apache.org/jira/browse/SPARK-42751
             Project: Spark
          Issue Type: Bug
          Components: Pandas API on Spark
    Affects Versions: 3.3.2
            Reporter: IonK


When you use the str.findall accessor method on a ps.series and you're passing a regex pattern that will return match groups, it will return a pyarrow data error.

In pandas the result is this:

 
{code:java}
df.to_pandas()[col].str.findall(regex_pattern, flags=re.IGNORECASE)

returns 

 [("value", , , , )],
 [("value", , , , )],
 [(, , ,value , )]{code}
In pyspark.pandas the result is:

org.apache.spark.api.python.PythonException: 'pyarrow.lib.ArrowTypeError: Expected bytes, got a 'tuple' object'.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org