-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BEAM-12563] swaplevel general function for dataframe and series #15944
[BEAM-12563] swaplevel general function for dataframe and series #15944
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15944 +/- ##
==========================================
+ Coverage 83.51% 84.78% +1.27%
==========================================
Files 445 453 +8
Lines 61390 71025 +9635
==========================================
+ Hits 51267 60217 +8950
- Misses 10123 10808 +685
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@TheNeuralBit Hi, I'm having troubles with the docs in this issue, the error refers to the pandas documentation, with the message |
The PythonDocs issue is really strange. I can take a look at what's going on there. Is this ready to go otherwise? |
The PythonDocs issue is because the docstring for swaplevel is a little mangled and it breaks some of our automation:
I proposed a change upstream (pandas-dev/pandas#44740), if that gets merged and released in 1.3.5 this issue should go away. If that takes a while or doesn't happen, we'll have to come up with some kind of workaround. I'll have to think on that. You should feel free to ignore this issue for now. |
@TheNeuralBit great! Aside of that, do you think is anything else I should change? |
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.
LGTM, this is ready to merge aside from the docs issue. I think the fix there may just be to wait until pandas 1.4.0 is out, pandas maintainers are uninterested in backporting the fix to 1.3.5
'swaplevel', | ||
lambda df: df.swaplevel(**kwargs), [self._expr], | ||
requires_partition_by=partitionings.Arbitrary(), | ||
preserves_partition_by=partitionings.Arbitrary())) |
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.
I wouldn't think this should preserve Index partitioning, since it modifies the index. But our test framework does verify this.
It turns out this expression does preserve index partitioning, since we generate hashes by summing hashes on the individual index levels, which is independent of the order of the index levels.
Just to be clear, no further action is needed from you @AlikRodriguez - I will take care of making sure this gets merged when the docs issue is resolved. |
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions. |
retest this please |
retest this please |
Run PythonDocs PreCommit |
@TheNeuralBit - What is the next step on this PR? |
Run PythonLint PreCommit |
Run Python PreCommit |
Thanks for the ping - this just needs a green CI run. |
Run PythonLint PreCommit |
4 similar comments
Run PythonLint PreCommit |
Run PythonLint PreCommit |
Run PythonLint PreCommit |
Run PythonLint PreCommit |
Implementation of
swaplevel
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
ValidatesRunner
compliance status (on master branch)Examples testing status on various runners
Post-Commit SDK/Transform Integration Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.