-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-43295][PS] Support string type columns for
DataFrameGroupBy.sum
### What changes were proposed in this pull request? This PR proposes to support string type columns for `DataFrameGroupBy.sum`. ### Why are the changes needed? To match the behavior with latest pandas. ### Does this PR introduce _any_ user-facing change? Yes, from now on the `DataFrameGroupBy.sum` follows the behavior of latest pandas as below: **Test DataFrame** ```python >>> psdf A B C D 0 1 3.1 a True 1 2 4.1 b False 2 1 4.1 b False 3 2 3.1 a True ``` **Before** ```python >>> psdf.groupby("A").sum().sort_index() B D A 1 7.2 1 2 7.2 1 ``` **After** ```python >>> psdf.groupby("A").sum().sort_index() B C D A 1 7.2 ab 1 2 7.2 ba 1 ``` ### How was this patch tested? Updated the existing UTs to support string type columns. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #42798 from itholic/SPARK-43295. Authored-by: Haejoon Lee <haejoon.lee@databricks.com> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
- Loading branch information
1 parent
eb0b09f
commit 3d119a5
Showing
4 changed files
with
28 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters