Skip to content

fix(search): validate methods before any candidate is fitted - #142

Open
xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/search-validate-methods
Open

xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/search-validate-methods

Conversation

@xillig

@xillig xillig commented Nov 11, 2026

Copy link
Copy Markdown

Problem

RepresentationSearchCV only met an invalid candidate inside its first fold:

  • methods="bspline" was iterated letter by letter and failed as the unknown method 'b';
  • a misspelled entry raised only after every candidate listed before it had been cross-validated;
  • numerical_method in preprocessor_params collided with the searched method in a bare TypeError from Preprocessor().

Fix

fit checks the candidates first and raises InvalidParamError naming the parameter. Names resolve through the registry as in Preprocessor(numerical_method=...), so aliases, None and registered representations stay valid.

Tests and docs

Tests in tests/compose/test_search.py, including one asserting that no estimator is fitted before the error; the class / fit docstrings and target_awareness.md are updated.

Validation

Checks: full suite (2551 passed, 59 skipped, 7 xfailed, coverage >= 94.79%), ruff format / ruff check, pyright (no new diagnostics), docs build with -W, scripts/quickstart.py. Merges cleanly with main and with #136.

RepresentationSearchCV only met an invalid candidate inside its first
fold, so three mistakes surfaced late or with a misleading error:

- methods="bspline" was iterated letter by letter and failed as the
  unknown method 'b';
- a misspelled entry raised only after every candidate listed before it
  had been cross-validated;
- numerical_method in preprocessor_params collided with the searched
  method in a bare TypeError from Preprocessor().

fit now checks the candidates first and raises InvalidParamError naming
the parameter. Names resolve as in Preprocessor(numerical_method=...),
so aliases and None stay valid.

This branch has not been deployed

No deployments
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.

1 participant