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

MINOR: [Python] Avoid failing pyarrow compute test on leap day #40288

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

jorisvandenbossche
Copy link
Member

Rationale for this change

Avoid creation of invalid datetimes when it is Feb 29, avoiding to have to investigate every four years why a lot of tests are failing

@bnavigator
Copy link

FTR: This is the error:

[  887s] _____________________________ test_count_distinct ______________________________
[  887s] [gw1] linux -- Python 3.9.18 /usr/bin/python3.9
[  887s] 
[  887s]     def test_count_distinct():
[  887s]         seed = datetime.datetime.now()
[  887s] >       samples = [seed.replace(year=y) for y in range(1992, 2092)]
[  887s] 
[  887s] ../../BUILDROOT/python-pyarrow-15.0.1-21.2.x86_64/usr/lib64/python3.9/site-packages/pyarrow/tests/test_compute.py:3210: 
[  887s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  887s] 
[  887s] .0 = <range_iterator object at 0x7f2df4ba7f60>
[  887s] 
[  887s] >   samples = [seed.replace(year=y) for y in range(1992, 2092)]
[  887s] E   ValueError: day is out of range for month
[  887s] 
[  887s] ../../BUILDROOT/python-pyarrow-15.0.1-21.2.x86_64/usr/lib64/python3.9/site-packages/pyarrow/tests/test_compute.py:3210: ValueError

Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

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

LGTM

@pitrou pitrou merged commit d3ae788 into apache:main Feb 29, 2024
12 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Feb 29, 2024
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Feb 29, 2024
@jorisvandenbossche jorisvandenbossche deleted the fix-leap-day branch February 29, 2024 13:06
Copy link

After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit d3ae788.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

thisisnic pushed a commit to thisisnic/arrow that referenced this pull request Mar 8, 2024
…e#40288)

### Rationale for this change

Avoid creation of invalid datetimes when it is Feb 29, avoiding to have to investigate every four years why a lot of tests are failing

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants