Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Fix cleanup type checks (#299)

Zack Krida6822a06442c4
diff --git a/ingestion_server/ingestion_server/cleanup.py b/ingestion_server/ingestion_server/cleanup.py
index 751a67219..d7f3b7d6e 100644
--- a/ingestion_server/ingestion_server/cleanup.py
+++ b/ingestion_server/ingestion_server/cleanup.py
@@ -104,9 +104,9 @@ class CleanupFunctions:
return None
for tag in tags:
below_threshold = False
- if "accuracy" in tag and tag["accuracy"] < TAG_MIN_CONFIDENCE:
+ if "accuracy" in tag and float(tag["accuracy"]) < TAG_MIN_CONFIDENCE:
below_threshold = True
- if "name" in tag:
+ if "name" in tag and isinstance(tag["name"], str):
lower_tag = tag["name"].lower()
should_filter = _tag_denylisted(lower_tag) or below_threshold
else: