-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Fix Polars GroupBy Issue #3348 This PR fixes an issue where group by transformations in Polars were not correctly referencing the original column names in the generated code. ## Changes - Modified the code generation in `print_code.py` to use `pl.col()` for group by columns - Added test case `test_polars_groupby_alias` to verify proper column name handling in group by transformations - Ensures both group by and aggregation operations reference original column names correctly ## Testing Added a new test that: - Creates a test DataFrame with "group" and "age" columns - Applies a group by transformation with max aggregation - Verifies the transformed DataFrame structure and values - Checks that the generated code correctly uses `pl.col()` for both group by and aggregation columns ## Link to Devin run https://app.devin.ai/sessions/ba11f083aa6b4f63857d6f1fbe11ac00 --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Myles Scolnick <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ad6a250
commit ce8cede
Showing
2 changed files
with
84 additions
and
7 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