Repository navigation
Conversation
#633's allowlist has no sktime transformers and no regressors, so the forecasting `transforms` block, tabular `sktime_class` transforms and `tsfm_regression` always failed with "not an allowed estimator class". Add the common ones that worked before #633. Callable-typed params (KNeighbors `metric`, ConditionalDeseasonalizer `seasonality_test`) can only receive instances of allowlisted classes, and a new test checks that none of those instances is callable. Signed-off-by: Shuxin Lin <linshuhsin@gmail.com>
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.
Description
Fixes the allowlist issue from the #633 review (comment on
resolver.py:33). The allowlist has no sktime transformers and no regressors, so these always fail with... is not an allowed estimator class:transformsblock inrun_recipesktime_classtransforms inrun_tabular_recipetsfm_regressiontabular taskrecipe_templateadvertises all three, and they worked before #633.08e817bfixed this, butebd792creverted it, so the #633 head is back to the failing state. This PR covers only the allowlist. The other two review points (open-then-verify reads, confiningtraining_args.output_dir) are not part of it.Fix Details
substrate/resolver.pyadds 33 exact paths toALLOWED_CLASSESin three groups:run_recipetransforms, plus the classes they nest:Detrender,Deseasonalizer,ConditionalDeseasonalizer,Differencer,LogTransformer,BoxCoxTransformer,ExponentTransformer,SqrtTransformer,Imputer,HampelFilter,TabularToSeriesAdaptor,PolynomialTrendForecaster,TrendForecaster,StandardScaler,MinMaxScaler,RobustScalerrun_tabular_recipetransforms:SummaryTransformer,Catch22,Rocket,MiniRocket,MiniRocketMultivariaterun_tabular_recipeestimators:RandomForestRegressor,GradientBoostingRegressor,ExtraTreesRegressor,LinearRegression,Ridge,Lasso,KNeighborsRegressor,ExtraTreesClassifier,GradientBoostingClassifier,LogisticRegression,KNeighborsClassifier,KMeansNone of these takes a file path or a pickle. Some take a callable (
KNeighbors*metric/weights,ConditionalDeseasonalizerseasonality_test,KMeansinit). A JSON recipe can only fill those with plain values or with instances_buildmakes from allowlisted classes, and none of those instances is callable. A new test checks that for every allowlisted class.FunctionTransformerstays out.Impact on Benchmarking
Related Issues
Verification Steps
uv run pytest src/servers/tsfm/tests -k "not integration": 149 passed (145 before plus 4 new). All the existing code-execution tests still pass.test_no_code_exec.py:test_every_allowed_class_imports_and_is_not_callable: imports every path, which catches typos or sktime path drift, and checks that no instance is callable.test_forecasting_transforms_still_run,test_tabular_regression_still_runs,test_tabular_sktime_transform_still_runs: one per broken route.run_recipe/run_tabular_recipe(32/32 runs; the scalers and trend forecasters run nested via_target_).uv run pytest src/ -k "not integration": 769 passed. The 2 failures insrc/observability/tests/test_file_exporter.pyfail the same way on the Aafeedback changes tsfm tools #633 head without this change.Checklist