-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
API: Index.__cmp__(Series) return NotImplemented #37160
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -744,11 +744,13 @@ def test_dti_cmp_tdi_tzawareness(self, other): | |
|
||
result = dti == other | ||
expected = np.array([False] * 10) | ||
tm.assert_numpy_array_equal(result, expected) | ||
if isinstance(other, Series): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this is technically a small api change? e.g. a dti == Series will now give a boolean Series? do we do this elsewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. API change, yes. not just DTI, but any There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm then i am no sure I like this api change. We return bool ndarrays on purpose from comparisions to avoid having to align everything. I think this could potentially be a nasty user trap. Is there a reason you want to do this (aside from reconciling / cleaning). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My motivation is pretty much "hunt down special cases" IIRC @jorisvandenbossche mentioned a ways back that the existing behavior is from a time before |
||
expected = Series(expected, index=other.index) | ||
tm.assert_equal(result, expected) | ||
|
||
result = dti != other | ||
expected = np.array([True] * 10) | ||
tm.assert_numpy_array_equal(result, expected) | ||
tm.assert_equal(result, ~expected) | ||
|
||
msg = "Invalid comparison between" | ||
with pytest.raises(TypeError, match=msg): | ||
dti < other | ||
|
Uh oh!
There was an error while loading. Please reload this page.