[ENH] Add exclude_tags parameter to all_objects #521#526
Open
direkkakkar319-ops wants to merge 3 commits intosktime:mainfrom
Open
[ENH] Add exclude_tags parameter to all_objects #521#526direkkakkar319-ops wants to merge 3 commits intosktime:mainfrom
direkkakkar319-ops wants to merge 3 commits intosktime:mainfrom
Conversation
Author
|
Hey, @fkiraly @felipeangelimvieira I'm a new contributor in this org and just raised this PR for Issue #521 |
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
Fixes #521
What does this implement/fix? Explain your changes.
all_objectshad afilter_tagsparameter to include objects by tagbut no symmetric
exclude_tagsto filter them out. This PR adds that.3 localized changes in
skbase/lookup/_lookup.py:exclude_tags=Noneparameter_filter_by_tagsfunction with inverted matching — clean and minimal5 new tests added in
skbase/tests/test_lookup.py:test_exclude_tags_none_is_noop—exclude_tags=Nonereturns all objectstest_exclude_tags_empty_dict_is_noop—exclude_tags={}returns all objectstest_exclude_tags_excludes_matching— correctly excludes by tag valuetest_exclude_tags_combined_with_filter_tags—filter_tags+exclude_tagswork together correctly
test_exclude_tags_multiple_conditions— multiple tag conditions work as conjunctionNo changes needed to
skbase/lookup/__init__.py(already re-exportsall_objectsdirectly) orget_package_metadata(different interface).Does your contribution introduce a new dependency? If yes, which one?
No new dependencies introduced.
What should a reviewer concentrate their feedback on?
_filter_by_tagslogic at lines 947-953 — is this thecleanest way to implement exclusion or would a separate helper be preferred?
in the file?
Any other comments?
black— passesflake8— 0 errorspytest— all 6 tests pass (1 existing + 5 new)The implementation is intentionally minimal and localized to
_lookup.pyonly, reusing the existing
_filter_by_tagshelper rather than introducingany new logic.
PR checklist
For all contributions
the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions