-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: fix wrong error message in deprecated 2D indexing of Series with datetime values #38099
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 2 commits
f55f514
a2cf40f
32436e4
95df80a
8bf5ae4
df0f6a2
61e7731
6391f54
e44bf53
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 |
---|---|---|
|
@@ -389,10 +389,19 @@ def test_getitem_generator(string_series): | |
tm.assert_series_equal(result2, expected) | ||
|
||
|
||
def test_getitem_ndim_deprecated(): | ||
s = Series([0, 1]) | ||
@pytest.mark.parametrize( | ||
"series", | ||
[ | ||
Series([0, 1]), | ||
Series(date_range("2012-01-01", periods=2)), | ||
Series(date_range("2012-01-01", periods=2, tz="CET")), | ||
], | ||
) | ||
def test_getitem_ndim_deprecated(series): | ||
with tm.assert_produces_warning(FutureWarning): | ||
s[:, None] | ||
res = series[:, None] | ||
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. prob worth testing the actual message (can pass to |
||
|
||
assert isinstance(res, np.ndarray) | ||
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. can you assert the result arrays (parameterize if needed) |
||
|
||
|
||
def test_getitem_multilevel_scalar_slice_not_implemented( | ||
|
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.
we recently started always-passing ndim to the constructor, so should never have None here
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 is backported though, so prob ok (but will need a patch on 1.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.
This is also done in the parent method, so can use a general clean-up for 1.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.
kk can you open an issue so we don't forget to do this