Gabriel Henrique created SPARK-61936:
----------------------------------------

             Summary:  Fix import pyspark.pandas with pandas 3.1 by porting 
infer_dtype_from_object
                 Key: SPARK-61936
                 URL: https://issues.apache.org/jira/browse/SPARK-61936
             Project: Spark
          Issue Type: Sub-task
          Components: Pandas API on Spark
    Affects Versions: 4.4.0, 5.0.0
            Reporter: Gabriel Henrique


pandas 3.1.0 removed the private helper 
pandas.core.dtypes.common.infer_dtype_from_object, which 
python/pyspark/pandas/frame.py imports at module level. As a result, import 
pyspark.pandas raises ImportError with pandas 3.1.

Port the helper to pyspark.pandas.utils using only public pandas and NumPy 
APIs, and make DataFrame.select_dtypes use it. Behavior is unchanged: the port 
returns the same result as the pandas helper for every input checked on pandas 
2.2.3 and 3.0.6.

This is the remaining half of the pandas 3.1 import failure; the DateOffset 
half was fixed by SPARK-61360.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to