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

TST: Add test to ensure DF describe does not throw an error (#32409) #38403

Merged
merged 5 commits into from
Jan 20, 2021

Conversation

luckyvs1
Copy link
Contributor

Notes:

  • Tested using pytest pandas/tests/frame/methods/test_describe.py::TestDataFrameDescribe::test_describe_does_not_raise_error and tested error format by calling a raise error line in the try block raise TypeError("Test message")
  • Re-created PR initial PR with rebase attempt in the following link: TST: Add test to ensure DF describe does not throw an error (#32409) #35270 -- but the diff didn't seem reasonable

@pep8speaks
Copy link

pep8speaks commented Dec 10, 2020

Hello @luckyvs1! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-01-20 14:40:02 UTC

)
result = df.describe()
tm.assert_frame_equal(result, expected)
exp_repr = (
Copy link
Member

Choose a reason for hiding this comment

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

Don't need to test the repr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this based on the feedback

@@ -298,3 +298,20 @@ def test_describe_percentiles_integer_idx(self):
],
)
tm.assert_frame_equal(result, expected)

def test_describe_does_not_raise_error(self):
Copy link
Member

Choose a reason for hiding this comment

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

Could you make this test name a bit more specific (the original issue looks related to dict-like elements)

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 have updated this now

@mroeschke
Copy link
Member

Looks like the CI is failing with this new test.

@rhshadrach rhshadrach added the Reshaping Concat, Merge/Join, Stack/Unstack, Explode label Dec 28, 2020
@luckyvs1 luckyvs1 requested a review from mroeschke January 18, 2021 05:44
@jreback jreback added this to the 1.3 milestone Jan 20, 2021
@jreback jreback added the Testing pandas testing functions or related to the test suite label Jan 20, 2021
@jreback
Copy link
Contributor

jreback commented Jan 20, 2021

@luckyvs1 can you merge master and ping on green

@luckyvs1 luckyvs1 force-pushed the add-test-for-describe-2 branch 2 times, most recently from a6d6353 to 6382b15 Compare January 20, 2021 07:25
@luckyvs1 luckyvs1 force-pushed the add-test-for-describe-2 branch from 6382b15 to c81561c Compare January 20, 2021 07:31
@luckyvs1
Copy link
Contributor Author

luckyvs1 commented Jan 20, 2021

@jreback I have updated this branch and also is up to date with the latest master and build is now passing, please take another look when you have a chance -- thanks!

@jreback jreback merged commit aab1744 into pandas-dev:master Jan 20, 2021
@jreback
Copy link
Contributor

jreback commented Jan 20, 2021

thanks @luckyvs1

@GreekGodOfStats
Copy link

I confirmed that returning DataFrame from a function will still raise exception "unhashable type: 'list'" if the DataFrame has any columns with illegal characters. I raised this exception with column named '\xa0'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reshaping Concat, Merge/Join, Stack/Unstack, Explode Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pandas1.0.1 has trouble with certain column names
6 participants