Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-14685: [Python] test case automatically detects byteorder of numpy object #11686

Closed
wants to merge 2 commits into from

Conversation

kiszk
Copy link
Member

@kiszk kiszk commented Nov 12, 2021

This PR fixes the following test failures

FAILED pyarrow/tests/test_pandas.py::test_timestamp_as_object_out_of_range - AssertionError: assert (dtype('O'), dtype('>M8[ns]')) == (dtype('O'), dtype('<M8[ns]'))

@github-actions
Copy link

@github-actions
Copy link

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@kiszk kiszk changed the title ARROW-14686: [Python] test case automatically detects byteorder of numpy object ARROW-14685: [Python] test case automatically detects byteorder of numpy object Nov 12, 2021
@github-actions
Copy link

assert (df.dateTimeMs.dtype, df.dateTimeNs.dtype) == (
# O == object, <M8[ns] == timestamp64[ns]
np.dtype("O"), np.dtype("<M8[ns]")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not super familiar with those endianness details, but would it be sufficient to compare against "M8[ns]" as well? (so without the explicit <, assuming the check is then robust across platforms)

Copy link
Member Author

@kiszk kiszk Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ursabot
Copy link

ursabot commented Nov 16, 2021

Benchmark runs are scheduled for baseline = 30ac30f and contender = 3abab2e. 3abab2e is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Scheduled] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.0% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] <https://buildkite.com/ursa-computing/benchmarks-ec2-t3-xlarge-us-east-2/builds/1507| 3abab2ee ec2-t3-xlarge-us-east-2>
[Finished] <https://buildkite.com/ursa-computing/benchmarks-ursa-i9-9960x/builds/1508| 3abab2ee ursa-i9-9960x>
[Finished] <https://buildkite.com/ursa-computing/benchmarks-ursa-thinkcentre-m75q/builds/1448| 3abab2ee ursa-thinkcentre-m75q>
[Finished] <https://buildkite.com/ursa-computing/benchmarks-ec2-t3-xlarge-us-east-2/builds/1506| 30ac30fd ec2-t3-xlarge-us-east-2>
[Finished] <https://buildkite.com/ursa-computing/benchmarks-ursa-i9-9960x/builds/1507| 30ac30fd ursa-i9-9960x>
[Finished] <https://buildkite.com/ursa-computing/benchmarks-ursa-thinkcentre-m75q/builds/1447| 30ac30fd ursa-thinkcentre-m75q>
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

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

Successfully merging this pull request may close these issues.

3 participants