-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Base Index Tests Cleanup Part 3 #20931
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
index = Index([' jack', 'jill ', ' jesse ', 'frank']) | ||
expected = Index([getattr(str, method)(x) for x in index.values]) | ||
|
||
result = getattr(index.str, method)() |
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.
I suppose the call signature here is different than what was previously in the test but I don't think that this should have any arguments (?)
tm.assert_numpy_array_equal(result, expected) | ||
assert isinstance(result, np.ndarray) | ||
|
||
def test_str_bool_series_indexing(self): |
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.
I split this test up, but conceptually do we even want / need this here? Seems like it would be better placed in the Series modules if even required
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.
yes, feel free to move tests as appropriate (can be followups to make diffs easier)
Codecov Report
@@ Coverage Diff @@
## master #20931 +/- ##
=======================================
Coverage 91.81% 91.81%
=======================================
Files 153 153
Lines 49478 49478
=======================================
Hits 45429 45429
Misses 4049 4049
Continue to review full report at Codecov.
|
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. some suggestions for followups. ping on green.
with pytest.raises(KeyError): | ||
idx.get_loc(1.1, method, tolerance=0.05) | ||
|
||
@pytest.mark.parametrize("method", [None, 'pad', 'backfill', 'nearest']) |
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.
could makes these a fixture as well (maybe fill_names_fixture)
tm.assert_numpy_array_equal(result, expected) | ||
assert isinstance(result, np.ndarray) | ||
|
||
def test_str_bool_series_indexing(self): |
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.
yes, feel free to move tests as appropriate (can be followups to make diffs easier)
thanks ! |
progress towards #20812