Repository navigation
[FIX] Handle polars string columns in the missing-value check - #1634
Closed
Raashish Aggarwal (raashish1601) wants to merge 1 commit into
Closed
Raashish Aggarwal (raashish1601) wants to merge 1 commit into
Raashish Aggarwal (raashish1601) wants to merge 1 commit into
Conversation
|
|
Contributor
|
This fix should be in utilsforecast, because the issue is really from the function |
Contributor
Author
|
Makes sense, |
Contributor
Author
|
Opened the fix in utilsforecast: Nixtla/utilsforecast#297. |
Contributor
Author
|
Closing in favor of Nixtla/utilsforecast#297, which fixes this in |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No existing issue.
Fitting on a polars frame that has a string categorical column (declared in
cat_exog_list) fails before the vocabulary is even built:_check_nanrunsufp.is_nan_or_noneon every temporal and static column. For polars that callsSeries.is_nan(), which only works on float columns. pandas is fine because it usesisna(). The categorical encoding already has a polars branch, so this check was the only thing blocking it.The check now uses
is_null()for non-float polars columns and keeps the old path for everything else. Nulls in a string column are still reported as missing values.Added
test_polars_string_categoricals_runintests/test_categorical.py. It fits and predicts with hist, futr and static string categoricals on polars, and checks that a null in a string column still raises. It fails on main and passes with this change.tests/test_categorical.pypasses locally, and so do the mask/missing-value tests intests/test_core.py.