Skip to content

Conversation

koperagen
Copy link
Collaborator

We need to match the order of columns in the runtime and in compiler plugin
GroupBy with the same schema should give the same result after aggregation, no matter how it was created
We cannot track position of group in original df, so we align asGroupBy with groupBy and move group column to end

@koperagen koperagen added the Compiler plugin Anything related to the DataFrame Compiler Plugin label Mar 26, 2025
@koperagen koperagen added this to the 1.0.0-Beta1 (0.16) milestone Mar 26, 2025
@koperagen koperagen self-assigned this Mar 26, 2025
@koperagen koperagen changed the title Ensure a stable order of columns after aggregation of GroupBy Ensure a predictable order of columns after aggregation of GroupBy Mar 26, 2025

res.columnsCount() shouldBe typed.columnsCount() + 1
res.getColumnIndex("earliest") shouldBe typed.getColumnIndex("items") + 1
withClue(res.columnNames() to typed.columnNames()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

wow what is this magic :o

Copy link
Collaborator Author

@koperagen koperagen Mar 28, 2025

Choose a reason for hiding this comment

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

It's a kotest utility. When assertion fails, it'll also print a "clue". In this case pair of lists
So instead of vague
4 should be 5
You get
[a, b, c, d], [a, b, c, c1, d]
4 should be 5

@Jolanrensen Jolanrensen self-requested a review March 27, 2025 17:29
@koperagen koperagen merged commit 390cd30 into master Mar 28, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler plugin Anything related to the DataFrame Compiler Plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants