[ 
https://issues.apache.org/jira/browse/ARROW-17018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kouhei Sutou resolved ARROW-17018.
----------------------------------
    Resolution: Fixed

Issue resolved by pull request 13553
[https://github.com/apache/arrow/pull/13553]

> [C++][Python] Timedelta dtype metadata base unit is globally mutated by the 
> Table.to_pandas() method
> ----------------------------------------------------------------------------------------------------
>
>                 Key: ARROW-17018
>                 URL: https://issues.apache.org/jira/browse/ARROW-17018
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>    Affects Versions: 8.0.0
>            Reporter: Phillip Cloud
>            Assignee: Phillip Cloud
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 9.0.0
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Here's a failing test case to demonstrate the issue:
> {code}
> def test_mutates_dtype():
>     import pyarrow as pa
>     expected = np.dtype('<m8')
>     assert np.dtype(np.timedelta64) == expected
>     df = pd.DataFrame({"a": [np.timedelta64()]})
>     t = pa.Table.from_pandas(df)
>     t.to_pandas()
>     assert np.dtype(np.timedelta64) == expected
> {code}



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

Reply via email to