Description
openedon Apr 24, 2023
Problem
In Provider API scripts, we often check if a required value exists using if <value> is None
checks:
openverse/catalog/dags/providers/provider_api_scripts/brooklyn_museum.py
Lines 119 to 124 in f5c6c7a
However, this lets other falsy values (such as empty strings) to pass the test, which might cause issues like WordPress/openverse-catalog#1102
Description
Since non-None falsy values (empty strings, empty dictionaries) do not make sense as values for required parameters such as foreign landing url or url, we should replace the is None
checks with if value
checks.
Alternatives
The current solution with checks for None
works in most cases, and the checks could be done in the MediaStore
classes. However, it moves the check back in the ingestion process, and makes it longer unnecessarily.
Additional context
The template for provider scripts should be updated, too.
Metadata
Assignees
Labels
Type
Projects
Status
✅ Done