kiszk commented on a change in pull request #11686:
URL: https://github.com/apache/arrow/pull/11686#discussion_r749827236
##########
File path: python/pyarrow/tests/test_pandas.py
##########
@@ -4328,9 +4328,14 @@ def make_df_with_timestamps():
})
# Not part of what we're testing, just ensuring that the inputs are what we
# expect.
+ if sys.byteorder == "little":
+ datetime_dtype = "<M8[ns]"
+ else:
+ datetime_dtype = ">M8[ns]"
assert (df.dateTimeMs.dtype, df.dateTimeNs.dtype) == (
- # O == object, <M8[ns] == timestamp64[ns]
- np.dtype("O"), np.dtype("<M8[ns]")
Review comment:
Thank you for your comment. This approach looks to work well.
```
>>> import numpy
>>> dt64 = numpy.datetime64('2002-06-28T01:00:00.000000000+0100', 's')
<stdin>:1: DeprecationWarning: parsing timezone aware datetimes is
deprecated; this will raise an error in the future
>>> dt64.dtype
dtype('>M8[s]')
>>> dt = numpy.dtype('M8[s]')
>>> print(dt64.dtype == dt)
True
>>> dtbe = numpy.dtype('>M8[s]')
>>> print(dt64.dtype == dtbe)
True
>>> dtle = numpy.dtype('<M8[s]')
>>> print(dt64.dtype == dtle)
False
```
--
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]