Skip to content

Commit

Permalink
Hotfix DatasetEntity.get_combined_subset function loop (#2577)
Browse files Browse the repository at this point in the history
Fix get_combined_subset function
  • Loading branch information
vinnamkim authored Oct 25, 2023
1 parent 0981035 commit 1285168
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/otx/api/entities/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,9 @@ def get_combined_subset(self, subsets: List[Subset]) -> "DatasetEntity":
Returns:
DatasetEntity: DatasetEntity with items matching subsets
"""
to_keep = set(subsets)
dataset = DatasetEntity(
items=[item for item in self._items if item.subset in set(subsets)],
items=[item for item in self if item.subset in to_keep],
purpose=self.purpose,
)
return dataset
Expand Down

0 comments on commit 1285168

Please sign in to comment.