Skip to content

fix: make the weekofyear alias work in time_features - #296

Merged
José Morales (jmoralez) merged 2 commits into
Nixtla:mainfrom
Blizzeq:fix/time-features-weekofyear
Oct 9, 2026
Merged

José Morales (jmoralez) merged 2 commits into
Nixtla:mainfrom
Blizzeq:fix/time-features-weekofyear

Conversation

@Blizzeq

Copy link
Copy Markdown
Contributor

time_features(..., features=["weekofyear"]) raised AttributeError on pandas, because the code calls isocalendar() for "week" and "weekofyear" and then looks the feature up by name, and the result only has year, week and day. Polars failed as well since there is no dt.weekofyear. I map weekofyear to week before the lookup, so both engines return the ISO week and the column keeps the name that was asked for. Added a test for pandas and polars that compares it with week.

@jmoralez
José Morales (jmoralez) merged commit 54fde8c into Nixtla:main Oct 9, 2026
17 of 18 checks passed
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.

2 participants