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

[SPARK-38971][PYTHON][TESTS] Test anchor frame for in-place Series.rename_axis #36269

Closed
wants to merge 1 commit into from

Conversation

xinrong-meng
Copy link
Member

What changes were proposed in this pull request?

Test anchor frame for in-place Series.rename_axis.

Why are the changes needed?

As a follow-up for #36250, we should ensure the in-place rename_axis on Series doesn't change its anchor frame.

Does this PR introduce any user-facing change?

No. Test only.

How was this patch tested?

Unit test.

pser.rename_axis("index2", inplace=True)
psser.rename_axis("index2", inplace=True)
self.assert_eq(pser.sort_index(), psser.sort_index())
# Note: in pandas, pdf.x's index is renamed, whereas pdf's index isn't due to a bug.
Copy link
Member Author

Choose a reason for hiding this comment

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

The code block has to be tested last since in-place rename_axis on pdf changes pdf.x accidentally.
See pandas-dev/pandas#46807.

@xinrong-meng xinrong-meng changed the title Test anchor frame for in-place Series.rename_axis [SPARK-38971][PYTHON] Test anchor frame for in-place Series.rename_axis Apr 20, 2022
@xinrong-meng xinrong-meng marked this pull request as ready for review April 20, 2022 17:36
@xinrong-meng
Copy link
Member Author

@ueshin @HyukjinKwon @itholic Thanks!

@HyukjinKwon
Copy link
Member

Merged to master.

@HyukjinKwon HyukjinKwon changed the title [SPARK-38971][PYTHON] Test anchor frame for in-place Series.rename_axis [SPARK-38971][PYTHON][TESTS] Test anchor frame for in-place Series.rename_axis Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants