forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-45143][PYTHON][CONNECT] Make PySpark compatible with PyArrow 1…
…3.0.0 ### What changes were proposed in this pull request? 1, in PyArrow 13.0.0, the behavior of [Table#to_pandas](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.to_pandas) and [ChunkedArray#to_pandas](https://arrow.apache.org/docs/python/generated/pyarrow.ChunkedArray.html#pyarrow.ChunkedArray.to_pandas) changed, set the `coerce_temporal_nanoseconds=True` 2, there is another undocumented breaking change in data type conversion [`TimestampType#to_pandas_dtype`](https://arrow.apache.org/docs/python/generated/pyarrow.TimestampType.html#pyarrow.TimestampType.to_pandas_dtype): 12.0.1: ``` In [1]: import pyarrow as pa In [2]: pa.timestamp("us", tz=None).to_pandas_dtype() Out[2]: dtype('<M8[ns]') In [3]: pa.timestamp("ns", tz=None).to_pandas_dtype() Out[3]: dtype('<M8[ns]') In [4]: pa.timestamp("us", tz="UTC").to_pandas_dtype() Out[4]: datetime64[ns, UTC] In [5]: pa.timestamp("ns", tz="UTC").to_pandas_dtype() Out[5]: datetime64[ns, UTC] ``` 13.0.0: ``` In [1]: import pyarrow as pa In [2]: pa.timestamp("us", tz=None).to_pandas_dtype() Out[2]: dtype('<M8[us]') In [3]: pa.timestamp("ns", tz=None).to_pandas_dtype() Out[3]: dtype('<M8[ns]') In [4]: pa.timestamp("us", tz="UTC").to_pandas_dtype() Out[4]: datetime64[us, UTC] In [5]: pa.timestamp("ns", tz="UTC").to_pandas_dtype() Out[5]: datetime64[ns, UTC] ``` ### Why are the changes needed? Make PySpark compatible with PyArrow 13.0.0 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? CI ### Was this patch authored or co-authored using generative AI tooling? NO Closes apache#42920 from zhengruifeng/py_pyarrow_13. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
- Loading branch information
1 parent
5d4ca79
commit c1c710e
Showing
6 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters