Skip to content

fix: Respect columns order in Model.examples#132

Open
gab23r wants to merge 1 commit intoJakobGM:mainfrom
gab23r:fix--examples-columns-order
Open

fix: Respect columns order in Model.examples#132
gab23r wants to merge 1 commit intoJakobGM:mainfrom
gab23r:fix--examples-columns-order

Conversation

@gab23r
Copy link
Copy Markdown

@gab23r gab23r commented Feb 18, 2025

fixes: #18

@gab23r gab23r marked this pull request as draft February 18, 2025 10:04
@gab23r gab23r force-pushed the fix--examples-columns-order branch from 392a677 to 5e7cd69 Compare February 18, 2025 11:03
Comment thread src/patito/pydantic.py
if column_name in cls.unique_columns:
unique_series.append(
pl.first().cum_count().cast(dtype).alias(column_name)
pl.int_range(pl.len()).cast(dtype).alias(column_name)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think this is more idiomatic

@gab23r gab23r marked this pull request as ready for review February 18, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Model.examples returns columns in reverse order when you pass a list

1 participant