Skip to content

TST: GH 32431 check print label indexing on nan #36635

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 5 commits into from
Nov 18, 2020

Conversation

wesleyboelrijk
Copy link
Contributor

This is my first contribution to pandas. I added a simple test that was requested in one of the open issues.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

Cool looks pretty good - thanks for the first contribution. Just a small change needed I think

# GH 32431
df = pd.Series([1, "{1,2}", 1, None])
vc = df.value_counts(dropna=False)
print(vc.loc[np.nan])
Copy link
Member

Choose a reason for hiding this comment

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

Rather than just printing you should construct the expected result and use tm.assert_series_equal(result, expected) - you should see this idiom throughout the test modules if you need a reference

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback! I constructed the expected result and expected an int. So I compared the results just with a normal assert, since I couldn't find a method on tm to assert ints. Please let me know if this satisfies your request

@WillAyd WillAyd added the Testing pandas testing functions or related to the test suite label Sep 25, 2020
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

See above

@WillAyd WillAyd added this to the 1.2 milestone Sep 29, 2020
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

lgtm @jreback

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Oct 30, 2020
@jreback jreback closed this Oct 31, 2020
@jreback jreback reopened this Oct 31, 2020
@jreback jreback removed the Stale label Oct 31, 2020
@jreback jreback merged commit 1d9912a into pandas-dev:master Nov 18, 2020
@jreback
Copy link
Contributor

jreback commented Nov 18, 2020

thanks @wesleyboelrijk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
4 participants