-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
CLN/TST: clean logic of old datetime test_indexing test #55523
Conversation
expected = ts["2001"] | ||
expected.name = "A" | ||
result = ts["2001"] | ||
tm.assert_series_equal(result, ts.iloc[:12]) |
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.
This expected
wasn't actually being used right now, and it's the result of the "getting" operation (with a timeseries partial indexing), so asserting the result instead.
ts["2001"] = 1 | ||
expected = ts["2001"] | ||
expected.name = "A" | ||
tm.assert_series_equal(ts, expected) |
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.
Similarly here, the result of setting ts["2001"] = 1
was no longer tested, and expected
wasn't actually used
with pytest.raises(KeyError, match="2001"): | ||
df["2001"] |
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.
Duplicated with 10 lines above
Thanks @jorisvandenbossche |
Breaking off a change I had to make for #55428, because it's actually unrelated to CoW and reduces the diff there a little bit.
I think that this test has over time, through several small changes, become quite useful / incomprehensible. So cleaning it up, and actually asserting what my understanding is that it was originally testing.