Skip to content

Commit

Permalink
Remove assets in export without labels (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
florianlega authored Oct 9, 2024
1 parent 039ee6e commit 89e2468
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/kili/services/export/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ def fetch_assets(

if (label_type_in is not None) and (len(label_type_in) > 0):
if export_type == "latest":
assets_gen = filter(lambda asset: asset.get("latestLabel") is not None, assets_gen)
assets_gen = filter(
lambda asset: asset["latestLabel"].get("labelType") in label_type_in, assets_gen
)
else:
assets_gen = filter(lambda asset: asset.get("labels") is not None, assets_gen)
assets_gen = filter(
lambda asset: any(
label.get("labelType") in label_type_in for label in asset["labels"]
Expand Down

0 comments on commit 89e2468

Please sign in to comment.