Skip to content

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

Merged
merged 6 commits into from
May 3, 2018
Merged

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented May 2, 2018

progress towards #20812

index = Index([' jack', 'jill ', ' jesse ', 'frank'])
expected = Index([getattr(str, method)(x) for x in index.values])

result = getattr(index.str, method)()
Copy link
Member Author

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):
Copy link
Member Author

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

Copy link
Contributor

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
Copy link

codecov bot commented May 2, 2018

Codecov Report

Merging #20931 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #20931   +/-   ##
=======================================
  Coverage   91.81%   91.81%           
=======================================
  Files         153      153           
  Lines       49478    49478           
=======================================
  Hits        45429    45429           
  Misses       4049     4049
Flag Coverage Δ
#multiple 90.21% <ø> (ø) ⬆️
#single 41.85% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b02c69a...2aae882. Read the comment docs.

Copy link
Contributor

@jreback jreback left a 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'])
Copy link
Contributor

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):
Copy link
Contributor

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)

@jreback jreback added Testing pandas testing functions or related to the test suite Clean labels May 3, 2018
@jreback jreback added this to the 0.23.0 milestone May 3, 2018
@jreback jreback merged commit cb5c869 into pandas-dev:master May 3, 2018
@jreback
Copy link
Contributor

jreback commented May 3, 2018

thanks !

@WillAyd WillAyd deleted the idx-clnup3 branch May 3, 2018 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants