You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xinrong Meng (Jira)" <ji...@apache.org> on 2021/07/14 23:51:00 UTC

[jira] [Created] (SPARK-36143) Adjust astype of Series of ExtensionDtype to follow pandas

Xinrong Meng created SPARK-36143:
------------------------------------

             Summary: Adjust astype of Series of ExtensionDtype to follow pandas
                 Key: SPARK-36143
                 URL: https://issues.apache.org/jira/browse/SPARK-36143
             Project: Spark
          Issue Type: Sub-task
          Components: PySpark
    Affects Versions: 3.2.0
            Reporter: Xinrong Meng


{code:java}
>>> pser = pd.Series([1, 2, np.nan], dtype=float)
>>> psser = ps.from_pandas(pser)
>>> pser.astype(int)
...
 ValueError: Cannot convert non-finite values (NA or inf) to integer
>>> psser.astype(int)
 0 1.0
 1 2.0
 2 NaN
 dtype: float64
{code}
As shown above, astype of Series of ExtensionDtype doesn't behave the same as pandas for ExtensionDtype Series, we ought to adjust that.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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