Skip to content
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: indexing/multiindex/test_getitem.py #24741

Merged
merged 15 commits into from
Jan 13, 2019

Conversation

simonjayhawkins
Copy link
Member

follow-on from #24452 to add section breaks and move tests. also KeyError checks made more explicit.

@codecov
Copy link

codecov bot commented Jan 12, 2019

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24741   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files         166      166           
  Lines       52358    52358           
=======================================
  Hits        48373    48373           
  Misses       3985     3985
Flag Coverage Δ
#multiple 90.81% <ø> (ø) ⬆️
#single 43.07% <ø> (ø) ⬆️

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 33f91d8...5ccf94a. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 12, 2019

Codecov Report

Merging #24741 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24741      +/-   ##
==========================================
+ Coverage   92.38%   92.39%   +<.01%     
==========================================
  Files         166      166              
  Lines       52358    52358              
==========================================
+ Hits        48373    48374       +1     
+ Misses       3985     3984       -1
Flag Coverage Δ
#multiple 90.81% <ø> (ø) ⬆️
#single 43.07% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 88.09% <0%> (+0.09%) ⬆️

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 33f91d8...f57ad2d. Read the comment docs.

@WillAyd WillAyd added Testing pandas testing functions or related to the test suite Clean labels Jan 12, 2019
@@ -15,6 +16,14 @@ def single_level_multiindex():
codes=[[0, 1, 2, 3]], names=['first'])


@pytest.fixture
def frame_random_data_integer_multi_index():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fixture duplicative of the one in conftest?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WillAyd : probably yes.. it is a dataframe with random data with an integer multi-level index, so multiindex_year_month_day_dataframe_random_data fixture could probably be used instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK - if you want to tackle that in a follow up always good to reduce duplication

(pd.IndexSlice[:, ['foo']], True, None),
(pd.IndexSlice[:, ['foo', 'bah']], True, None)
])
def test_getitem_duplicates_multiindex_missing_indexers(indexer, is_level1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it's better to rename these get_loc since that is in fact what they are testing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WillAyd agreed. this PR is cleaning up test_getitem.py after splitting and parametrizing. that task is still to do for test_loc.py so the renaming can be done in that cleanup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have renamed tests moved to test_loc.py to include loc_getitem

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. ex @WillAyd commets

@WillAyd WillAyd merged commit f160c7d into pandas-dev:master Jan 13, 2019
@WillAyd
Copy link
Member

WillAyd commented Jan 13, 2019

Thanks @simonjayhawkins keep them coming!

@simonjayhawkins simonjayhawkins deleted the clean-mi-getitem branch January 15, 2019 19:53
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
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.

3 participants