-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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 infinite recursion loop when pivot of IntervalTree is ±inf #46664
BUG: Fix infinite recursion loop when pivot of IntervalTree is ±inf #46664
Conversation
8a9514b
to
c82d0fb
Compare
looks good. if you make non-draft can merge. |
c82d0fb
to
c0ba6cf
Compare
Please also see my comment to the issue. I am in particular stuck with what to do about the CI failure. |
93d50c4
to
4a11347
Compare
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
de9e54a
to
157d836
Compare
Skipping now the newly introduced tests on 32-bit like other tests of |
@@ -207,3 +207,21 @@ def test_interval_tree_error_and_warning(self): | |||
): | |||
left, right = np.arange(10), [np.iinfo(np.int64).max] * 10 | |||
IntervalTree(left, right, closed="both") | |||
|
|||
@pytest.mark.skipif(not IS64, reason="GH 23440") |
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.
Prefer xfail
over skipif
just in case this gets fixed in the future
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.
You mean like this?
@pytest.mark.xfail(not IS64, strict=False, reason="GH 23440")
That would be inconsistent with the other skipif
s in the file. So maybe we should change all of 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.
Yeah, but without the strict=False
(unless you know this test is specifically flaky and passes sometimes)
Generally we use xfail
if a test has a chance to be fixed in the future and skipif
if the test is never expected to pass/covered somewhere else.
Can change the skipif
in another PR if it meets the above criteria for xfailing.
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.
Ok, done.
157d836
to
d792429
Compare
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.
One more item otherwise LGTM
Attempts to fix pandas-dev#46658. When the pivot of an IntervalTree becomes ±inf the construction of the IntervalTree comes to an infinite loop recursion. This patch tries to fix that by catching those cases and set the pivot to a reasonable value. Note that the tests are skipped on 32-bit systems (see pandas-dev#23440)
d792429
to
f2c75c3
Compare
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.
lgtm
cc @mroeschke when you are good |
Thanks @johannes-mueller |
…andas-dev#46664) Attempts to fix pandas-dev#46658. When the pivot of an IntervalTree becomes ±inf the construction of the IntervalTree comes to an infinite loop recursion. This patch tries to fix that by catching those cases and set the pivot to a reasonable value. Note that the tests are skipped on 32-bit systems (see pandas-dev#23440)
When the pivot of an IntervalTree becomes ±inf the construction of the
IntervalTree comes to an infinite loop recursion. This patch tries to fix that
by catching those cases and set the pivot to a reasonable value.
doc/source/whatsnew/v1.5.0.rst
file if fixing a bug or adding a new feature.