Skip to content

Commit

Permalink
[BUG] fix retrieval in all_objects if filter_tags is provided (#141)
Browse files Browse the repository at this point in the history
This PR fixes an unreported bug in `all_objects` when both the
`object_type` and `filter_tags` were provided.

In this case, only the `filter_tags` filter would be applied.
  • Loading branch information
fkiraly authored Nov 1, 2023
1 parent 9cf4b0e commit 4e4e816
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion skpro/registry/_lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ def all_objects(

if object_types:
if filter_tags and "object_type" not in filter_tags.keys():
object_tag_filter = {}
object_tag_filter = {"object_type": object_types}
elif filter_tags:
filter_tags_filter = filter_tags.get("object_type", [])
if isinstance(object_types, str):
object_types = [object_types]
object_tag_update = {"object_type": object_types + filter_tags_filter}
filter_tags.update(object_tag_update)
else:
object_tag_filter = {"object_type": object_types}
if filter_tags:
Expand Down

0 comments on commit 4e4e816

Please sign in to comment.