tadeja commented on code in PR #51404:
URL: https://github.com/apache/arrow/pull/51404#discussion_r4163913027
##########
python/pyarrow/tests/test_pandas.py:
##########
@@ -5006,7 +5006,7 @@ def test_does_not_mutate_timedelta_dtype():
assert np.dtype(np.timedelta64) == expected
- df = pd.DataFrame({"a": [np.timedelta64()]})
+ df = pd.DataFrame({"a": [np.timedelta64(0, "s")]})
Review Comment:
Fyi, @AlenkaF @jorisvandenbossche, running
`test_does_not_mutate_timedelta_dtype()` on current PR but with
[pre-13553](https://github.com/apache/arrow/pull/13553/changes#diff-d16c6f82df0c35bc3791cd26cd4107c20d5c7532d5c7ff9737d701aa9b65dc4bL170)
`if (type == NPY_DATETIME) {` then both asserts pass - shouldn't that fail?
But with these changes (what you @AlenkaF had just before
https://github.com/apache/arrow/commit/a148c139ca6d8d498c06ecd9f6d0aa0d78da48a2)
```diff
def test_does_not_mutate_timedelta_dtype():
- expected = np.dtype('<m8[s]')
+ expected = np.dtype('m8')
- assert np.dtype(np.timedelta64(0, "s")) == expected
+ assert np.dtype(np.timedelta64) == expected
df = pd.DataFrame({"a": [np.timedelta64(0, "s")]})
t = pa.Table.from_pandas(df)
t.to_pandas()
- assert np.dtype(np.timedelta64(0, "s")) == expected
+ assert np.dtype(np.timedelta64) == expected
```
at least second assert does (correctly) fail :shrug:
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]