-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Support For Interval __contains__ Other Interval (#46613) #47927
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
Conversation
@@ -36,10 +36,6 @@ def test_contains(self, interval): | |||
assert 1 in interval | |||
assert 0 not in interval | |||
|
|||
msg = "__contains__ not defined for two intervals" |
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.
Changed by this enhancement.
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! Need to fix the tests now
Apologies for the mess in the history! I suggested @kapiliyer rebase rather than merge and I'm seeing now that the history's in a weird state. Later today I'll work with him to get his branch into a cleaner state. |
Co-authored-by: Valentin Iovene <[email protected]>
History should be in a saner state now. Apologies again for the trouble! |
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
@@ -410,7 +412,17 @@ cdef class Interval(IntervalMixin): | |||
|
|||
def __contains__(self, key) -> bool: | |||
if _interval_like(key): | |||
raise TypeError("__contains__ not defined for two intervals") | |||
key_closed_left = key.inclusive in ('left', 'both') |
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.
cc @venaturum if you'd like to review if this aligns with piso
Thanks @kapiliyer! |
…) (pandas-dev#47927) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Update doc/source/whatsnew/v1.5.0.rst Co-authored-by: Valentin Iovene <[email protected]> * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) Co-authored-by: Valentin Iovene <[email protected]>
…) (pandas-dev#47927) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Update doc/source/whatsnew/v1.5.0.rst Co-authored-by: Valentin Iovene <[email protected]> * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) * Fix: Unintentionally Modified Range * ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613) Co-authored-by: Valentin Iovene <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.