-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Fixturize tests/frame/test_apply #22735
Conversation
Hello @h-vetinari! Thanks for submitting the PR.
|
0107e16
to
bbc92b2
Compare
Codecov Report
@@ Coverage Diff @@
## master #22735 +/- ##
==========================================
+ Coverage 92.17% 92.18% +<.01%
==========================================
Files 169 169
Lines 50778 50815 +37
==========================================
+ Hits 46807 46845 +38
+ Misses 3971 3970 -1
Continue to review full report at Codecov.
|
@WillAyd Green |
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.
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.
Just a few minor comments but otherwise looks good
pandas/tests/frame/test_apply.py
Outdated
expected = DataFrame( | ||
np.tile(np.arange(3, dtype='int64'), 6).reshape(6, -1) + 1, | ||
columns=['test', 'other', 'cols']) | ||
expected = DataFrame(int_frame_const_col.values, |
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.
Instead of using the DataFrame constructor can you just rename the columns to get to the same place?
pandas/tests/frame/test_apply.py
Outdated
columns=['test', 'other']) | ||
result = df.apply(lambda x: Series([1, 2], index=['test', 'other']), | ||
axis=1) | ||
expected = DataFrame(int_frame_const_col.values[:, :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.
Similar comment as above - would be more idiomatic than slicing .values
on the frame and passing to a constructor
@h-vetinari i will look at all of the PRs soon |
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.
will look soon
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.
looks fine. small change, ping on green.
pandas/tests/frame/conftest.py
Outdated
@@ -40,6 +40,18 @@ def int_frame(): | |||
return DataFrame({c: s for c, s in compat.iteritems(df)}, dtype=np.int64) | |||
|
|||
|
|||
@pytest.fixture |
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.
so don't add this here, rather make it a fixture in test_apply.py; this conftest is for pretty common fixtures, this is not one of them (of course if could decide later to change this)
lgtm. ping on green. |
@h-vetinari : Thanks! |
Split off from #22730 as per review from @WillAyd