[ENH] extend all_objects tag_filter to allow str or list of str for filtering#422
[ENH] extend all_objects tag_filter to allow str or list of str for filtering#422DebjyotiRay wants to merge 6 commits intosktime:mainfrom
all_objects tag_filter to allow str or list of str for filtering#422Conversation
…ly handles 'filter_tags' as a dict
|
Hello! Please let me know your review on them. |
all_objects tag_filter to allow str or list of str for filtering
| if tag_filter is None: | ||
| return True | ||
|
|
||
| type_msg = ( |
There was a problem hiding this comment.
it looks like the function already allowed for iterable of str or str
There was a problem hiding this comment.
True, tho! The function already had full support for both single strings and iterables of strings.
I did add redundant but more granular and edge case tests of the existing functionality; already implemented and working.
Should I remove those new tests I added?
There was a problem hiding this comment.
it seems like you are still changing the logic itself, making it less general, and removing the useful error message.
fkiraly
left a comment
There was a problem hiding this comment.
Thanks.
Reviewing the code, it appears that the current all_objects already allowed the user to pass str or listof str. This was only not reflected in the docstring.
Can you please check whether the changes to all_objects were necessary?
Sorry for not noticing this earlier.
The tests are useful still, though.
|
Hello @fkiraly ! |
[ENH] Add filter_tags preprocessing to accept strings and lists in all_objects and get_package_metadata
Reference Issues
Fixes #8210 from sktime
Changes:
This PR enhances the all_objects and get_package_metadata functions by adding preprocessing logic for the filter_tags parameter. Previously, these functions only handled filter_tags as a dict. Now they accept more user-friendly input formats:
i) String input:
filter_tags="A"→ converts to{"A": True}ii) List/tuple input:
filter_tags=["A", "B"]→ converts to{"A": True, "B": True}iii) Dict input: Existing functionality preserved (dict is copied to prevent modification)
iv) Error handling: Clear TypeError for invalid input types
What should a reviewer concentrate their feedback on?