[FIX] : Add substring fallback for tag suggestions in list_estimators#366
Open
Rohitstwt wants to merge 1 commit into
Open
[FIX] : Add substring fallback for tag suggestions in list_estimators#366Rohitstwt wants to merge 1 commit into
Rohitstwt wants to merge 1 commit into
Conversation
When an invalid tag key like 'pred_int' is passed, difflib alone fails to suggest 'capability:pred_int' because the prefix changes similarity score below the cutoff threshold. Adds _suggest_tag helper that first tries difflib, then falls back to substring matching so 'pred_int' correctly suggests ['capability:pred_int', 'capability:pred_int:insample']. Also fixes docstring listing only 6 of 9 valid task types. Adds tests/test_list_estimators.py with 7 tests covering invalid task errors, invalid tag errors, substring suggestions, and valid inputs.
This was referenced Apr 29, 2026
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
Related to #35 (early adopter feedback - tag suggestion returning None for partial key matches)
What does this implement/fix?
When an invalid tag key like
pred_intis passed tolist_estimators_tool, the existing code returnssuggestions: Noneeven thoughcapability:pred_intexists in the registry.Root cause:
difflib.get_close_matchesscorespred_intvscapability:pred_intbelow the 0.6 cutoff because thecapability:prefix makes them too dissimilar.Before:
After:
Fix: adds a
_suggest_taghelper that first tries difflib, then falls back to substring matching when difflib finds nothing.Also fixes the docstring which listed only 6 of 9 valid task types (missing
parameter_estimation,splitting,network).Does your contribution introduce a new dependency? If yes, which one?
No. Uses only
difflibfrom the Python standard library, which was already imported.What should a reviewer concentrate their feedback on?
_suggest_taghelper insrc/sktime_mcp/tools/list_estimators.pyand whether the substring fallback logic is soundtests/test_list_estimators.pycovering invalid task errors, invalid tag errors, substring suggestions, and valid inputs passing cleanlyAny other comments?
Discovered while doing early adopter testing as part of #35.
PR checklist
For all contributions