Skip to content

DOC: Broken import in snippet (pandas.testing.assert_frame_equal) #43778

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

Closed
1 task done
BryanRacic opened this issue Sep 28, 2021 · 0 comments · Fixed by #43779
Closed
1 task done

DOC: Broken import in snippet (pandas.testing.assert_frame_equal) #43778

BryanRacic opened this issue Sep 28, 2021 · 0 comments · Fixed by #43779
Labels
Docs Testing pandas testing functions or related to the test suite
Milestone

Comments

@BryanRacic
Copy link
Contributor

  • I have checked that the issue still exists on the latest versions of the docs on master here

Location of the documentation

I have checked that the issue still exists on the latest versions of the docs on master: https://pandas.pydata.org/docs/dev/reference/api/pandas.testing.assert_frame_equal.html

"pandas.testing.assert_frame_equal"

Documentation problem

Example snippet for assert_frame_equal has a leading underscore in the import statement (for testing). I think this is unnecessary and breaks execution when attempted by a user.

from pandas._testing import assert_frame_equal
df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})

Suggested fix for documentation

Remove the underscore in question:

from pandas.testing import assert_frame_equal
df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})

This should fix execution.

@BryanRacic BryanRacic added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 28, 2021
@lithomas1 lithomas1 added Testing pandas testing functions or related to the test suite and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Oct 2, 2021
@lithomas1 lithomas1 added this to the 1.4 milestone Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants