diff --git a/ingestion_server/ingestion_server/cleanup.py b/ingestion_server/ingestion_server/cleanup.py index 06bc54c996e..cd2ba2fd499 100644 --- a/ingestion_server/ingestion_server/cleanup.py +++ b/ingestion_server/ingestion_server/cleanup.py @@ -57,7 +57,7 @@ TAG_MIN_CONFIDENCE = 0.90 # Filter out tags that match the following providers (either because they haven't # been vetted or because they are known to be low-quality). -TAG_SKIP_PROVIDERS = {"rekognition"} +FILTERED_TAG_PROVIDERS = {"rekognition"} # We know that flickr and wikimedia support TLS, so we can add them here TLS_CACHE = { @@ -139,7 +139,7 @@ def cleanup_tags(tags): alt_filtered = False if "accuracy" in tag and float(tag["accuracy"]) < TAG_MIN_CONFIDENCE: alt_filtered = True - if "provider" in tag and tag["provider"] in TAG_SKIP_PROVIDERS: + if "provider" in tag and tag["provider"] in FILTERED_TAG_PROVIDERS: alt_filtered = True if "name" in tag and isinstance(tag["name"], str): lower_tag = tag["name"].lower() diff --git a/ingestion_server/test/unit_tests/test_cleanup.py b/ingestion_server/test/unit_tests/test_cleanup.py index 00cd7f45085..f09f6608857 100644 --- a/ingestion_server/test/unit_tests/test_cleanup.py +++ b/ingestion_server/test/unit_tests/test_cleanup.py @@ -1,7 +1,7 @@ import pook from psycopg2._json import Json -from ingestion_server.cleanup import TAG_SKIP_PROVIDERS, CleanupFunctions +from ingestion_server.cleanup import FILTERED_TAG_PROVIDERS, CleanupFunctions from test.unit_tests.conftest import create_mock_image @@ -46,7 +46,7 @@ def test_provider_filter(): {"name": "valid", "provider": "provider1"}, *[ {"name": "invalid", "provider": provider} - for provider in TAG_SKIP_PROVIDERS + for provider in FILTERED_TAG_PROVIDERS ], ] result = str(CleanupFunctions.cleanup_tags(tags))