Repository navigation
fix: reject more than one static row in predict requests - #139
Open
abhinav-phi wants to merge 1 commit into
Open
abhinav-phi wants to merge 1 commit into
abhinav-phi wants to merge 1 commit into
Conversation
PredictRequest and CoercedPredictRequest accepted a static table with several rows and the sktime converter silently kept the first one. Require exactly one row in both models and cover the column dict, row matrix and narwhals cases in the model tests.
This branch has not been deployed
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.
Fixes #138
staticfeatures are broadcast over every time step, but neitherPredictRequestnorCoercedPredictRequestchecked the row count. A requestwith
static={"store": ["urban", "rural"]}passed validation and the sktimeconverter kept row 0, dropping the rest silently.
PredictRequestnow rejects a static table without exactly one row, for thecolumn dict, the
{columns, data}matrix and the pandas/polars/pyarrow/narwhals shapes (via
_check_static_rowsintypes/_checks.py).CoercedPredictRequestgets the same check on the narwhals frame._static()keeps its existing empty-frame error.Tests in
src/tserve/types/tests/test_models.py:The failing cases are
static_multi_row_column_dict,static_multi_row_matrixand
static_multi_row;test_single_row_static_is_acceptedcovers the validpath.