-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
BUG: Fix IntervalTree handling of NaN #23353
Conversation
Hello @jschendel! Thanks for submitting the PR.
|
Does this apply to |
|
Codecov Report
@@ Coverage Diff @@
## master #23353 +/- ##
==========================================
- Coverage 92.22% 92.18% -0.05%
==========================================
Files 169 161 -8
Lines 51258 51160 -98
==========================================
- Hits 47274 47161 -113
- Misses 3984 3999 +15
Continue to review full report at Codecov.
|
# GH 23352 | ||
left, right = [0, 1, 2, np.nan], [1, 2, 3, np.nan] | ||
with tm.assert_produces_warning(None): | ||
IntervalTree(left, right, leaf_size=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what exactly does this produce though? are the nan's valid? you are just dropping them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intent here was to verify that the RuntimeWarning
described in the issue is not occurring. I guess this test isn't really necessary, as at least one CI instance is set to fail if warnings are raised. Removed this test, and instead parametrized the tree
fixture to include leaf_size
that will trigger the warning and cause the invalid behavior described in the issue (so beyond just a warning would cause the asserts to fail if there's a regression).
this broke 32 bit builds can u have a look @jschendel |
@jreback : it looks like this 32 bit failure is something that's come up before and is currently explicitly skipped in the other test where it occurs: pandas/pandas/tests/indexes/interval/test_interval_tree.py Lines 88 to 91 in de39bfc
This was done before my time, so not sure about the exact history here. My plan is to similarly skip the newly written tests and open a relevant issue to formally document this. It doesn't seem particularly pressing to fix since this has been present for a while, only impacts 32 bit, and there haven't been any issues opened. Can look into fixing it if I'm mistaken, though I don't immediately see what needs to be done. |
git diff upstream/master -u -- "*.py" | flake8 --diff
xref #23327 : As far as I can tell the only reason that PR is failing is because of tests raising a
RuntimeWarning
due to this bug.