Skip to content

[SPARK-54938][PYTHON][TEST][FOLLOW-UP] Fix inferred time unit for pandas >= 3#55158

Open
zhengruifeng wants to merge 1 commit intoapache:masterfrom
zhengruifeng:fix-pyarrow-ts-inference
Open

[SPARK-54938][PYTHON][TEST][FOLLOW-UP] Fix inferred time unit for pandas >= 3#55158
zhengruifeng wants to merge 1 commit intoapache:masterfrom
zhengruifeng:fix-pyarrow-ts-inference

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Fix inferred time unit for pandas >= 3

Why are the changes needed?

there is behavior change in pandas 3

Does this PR introduce any user-facing change?

No, test-only

How was this patch tested?

manually check

pandas=2.3.3

In [7]: pd.__version__
Out[7]: '2.3.3'

In [8]: pd.Series(pd.to_datetime(["2024-01-01", "2024-01-02"])).dtype
Out[8]: dtype('<M8[ns]')

In [9]: pa.array(pd.Series(pd.to_datetime(["2024-01-01", "2024-01-02"]))).type
Out[9]: TimestampType(timestamp[ns])

pandas=3.0.1

In [6]: pd.__version__
Out[6]: '3.0.1'

In [7]: pd.Series(pd.to_datetime(["2024-01-01", "2024-01-02"])).dtype
Out[7]: dtype('<M8[us]')

In [8]: pa.array(pd.Series(pd.to_datetime(["2024-01-01", "2024-01-02"]))).type
Out[8]: TimestampType(timestamp[us])

Was this patch authored or co-authored using generative AI tooling?

Co-authored-by: Claude code (Opus 4.6)

…ution

Pandas 3 changed the default datetime resolution from nanoseconds to microseconds. Update `test_pandas_series_numpy_backed` to use the correct resolution based on the Pandas version.

Co-authored-by: Isaac
@zhengruifeng
Copy link
Copy Markdown
Contributor Author

cc @Yicong-Huang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant