Skip to content

add test cases for GroupBy.apply trivial cases #20081

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 3 commits into from
Mar 13, 2018
Merged

add test cases for GroupBy.apply trivial cases #20081

merged 3 commits into from
Mar 13, 2018

Conversation

zym1010
Copy link
Contributor

@zym1010 zym1010 commented Mar 9, 2018

@codecov
Copy link

codecov bot commented Mar 10, 2018

Codecov Report

Merging #20081 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #20081      +/-   ##
==========================================
- Coverage   91.72%    91.7%   -0.03%     
==========================================
  Files         150      150              
  Lines       49122    49137      +15     
==========================================
+ Hits        45057    45060       +3     
- Misses       4065     4077      +12
Flag Coverage Δ
#multiple 90.08% <ø> (-0.03%) ⬇️
#single 41.85% <ø> (-0.02%) ⬇️
Impacted Files Coverage Δ
pandas/plotting/_converter.py 65.07% <0%> (-1.74%) ⬇️
pandas/io/html.py 86.6% <0%> (+0.62%) ⬆️

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 7c14e4f...ac6d5ae. Read the comment docs.

@@ -233,6 +233,39 @@ def test_apply_issues(self):
lambda x: x['time'][x['value'].idxmax()])
assert_series_equal(result, expected)

def test_apply_trivial(self):
# GH 20066
def gen_one_df(start=0):
Copy link
Contributor

Choose a reason for hiding this comment

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

you dont need a function for this, just create the dataframe directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in my last commit.


assert_frame_equal(result, expected)

@pytest.mark.xfail(reason="didn't work yet")
Copy link
Contributor

Choose a reason for hiding this comment

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

can you mark the issue and provide some more explanation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in my last commit.

@@ -233,6 +233,39 @@ def test_apply_issues(self):
lambda x: x['time'][x['value'].idxmax()])
assert_series_equal(result, expected)

def test_apply_trivial(self):
# GH 20066
Copy link
Contributor

Choose a reason for hiding this comment

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

can you provide a 1-line comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in my last commit.

@jreback jreback added Testing pandas testing functions or related to the test suite Groupby labels Mar 10, 2018
@zym1010 zym1010 changed the title add test cases for groupby apply trivial cases add test cases for GroupBy.apply trivial cases Mar 10, 2018
@jreback
Copy link
Contributor

jreback commented Mar 10, 2018

slightly off topic. It would be nice to split up tests_groupby.py somewhat if you would like to tackle this. Ideally would group some similar tests together and split out some to either existing sub-modules or some new ones.

@zym1010
Copy link
Contributor Author

zym1010 commented Mar 10, 2018

@jreback probably not right now. I've just learned to use GroupBy stuffs... and then got hit by a bug...

@jreback jreback added this to the 0.23.0 milestone Mar 10, 2018
@jreback
Copy link
Contributor

jreback commented Mar 10, 2018

thanks. will merge after the doc sprint.

@jreback jreback merged commit 3783ccc into pandas-dev:master Mar 13, 2018
@jreback
Copy link
Contributor

jreback commented Mar 13, 2018

thanks @zym1010

love for you to look into this issue (or others!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby 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