fix: raise error for missing explicit exogenous columns#441
Open
Saloni-0465 wants to merge 1 commit intosktime:mainfrom
Open
fix: raise error for missing explicit exogenous columns#441Saloni-0465 wants to merge 1 commit intosktime:mainfrom
Saloni-0465 wants to merge 1 commit intosktime:mainfrom
Conversation
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.
Reference Issues/PRs
N/A
What does this implement/fix? Explain your changes.
This PR fixes silent dropping of explicitly requested exogenous columns during data conversion.
Previously, if a config specified
exog_columns=["promo", "holiday"]but onlypromoexisted in the loaded data,to_sktime_formatwould silently use the available column and ignore the missing one. This could mislead users or LLM agents into thinking all requested covariates were used.This PR updates
DataSourceAdapter.to_sktime_formatto validate explicitexog_columnsbefore constructingX. If any requested exogenous column is missing, it raises a clearValueErrorlisting the missing columns and available columns. When all requested columns exist, their order is preserved exactly.Does your contribution introduce a new dependency? If yes, which one?
No.
What should a reviewer concentrate their feedback on?
exog_columnsshould fail fast rather than warnDataSourceAdapter.to_sktime_formatAny other comments?
This is a small data-contract safety fix for custom data workflows. It helps prevent agents from making forecasting decisions under the false assumption that missing exogenous variables were used.
Validation:
python -m compileall src/sktime_mcp/data/base.py tests/test_data_exog_column_validation.pyholidayinexog_columnsraises a clearValueErrorExecutor.load_data_sourcereturnssuccess=Falsewitherror_type="ValueError"PR checklist
For all contributions
For new estimators