Skip to content

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound committed Jul 30, 2024
1 parent 1954b0d commit a80b216
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ingestion_server/ingestion_server/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions ingestion_server/test/unit_tests/test_cleanup.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit a80b216

Please sign in to comment.