Skip to content

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

Merged
mkumar73 merged 2 commits into
OpenTabular:mainfrom
xillig:fix/search-validate-methods
Nov 27, 2026
Merged

mkumar73 merged 2 commits into
OpenTabular:mainfrom
xillig:fix/search-validate-methods

Conversation

@xillig

@xillig xillig commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

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.

xillig and others added 2 commits November 11, 2026 05:46
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.
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mkumar73
mkumar73 merged commit 51c340c into OpenTabular:main Nov 27, 2026
19 checks passed
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.

3 participants