Skip to content

Commit

Permalink
Add Collect creator method data from Europeana API (Fixes WordPress#2834
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dryruffian committed Oct 26, 2024
1 parent 7e72f13 commit 38d982c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion catalog/dags/providers/provider_api_scripts/europeana.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def _get_creator(self, data: dict) -> str | None:
if isinstance(creators, list):
if not creators: # Explicitly handle empty list
return None
return ", ".join(creators)
return ",".join(creators)
elif isinstance(creators, str):
return creators
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,8 @@ def test_record_builder_get_record_data(ingester, record_builder):
"description": "Sello en seco: España artística y monumental.",
}

expected_creator = (
"http://hispana.mcu.es/lod/oai:bibliotecadigital.jcyl.es:26229#ent2, "
"http://hispana.mcu.es/lod/oai:bibliotecadigital.jcyl.es:26229#ent3, "
"http://hispana.mcu.es/lod/oai:bibliotecadigital.jcyl.es:26229#ent4"
)
expected_creator = "http://hispana.mcu.es/lod/oai:bibliotecadigital.jcyl.es:26229#ent2,http://hispana.mcu.es/lod/oai:bibliotecadigital.jcyl.es:26229#ent3,http://hispana.mcu.es/lod/oai:bibliotecadigital.jcyl.es:26229#ent4"


assert record_data == {
"foreign_landing_url": (
Expand Down Expand Up @@ -299,7 +296,7 @@ def test_get_image_dimensions(item_data, expected, record_builder):
# Multiple creators in a list
pytest.param(
{"dcCreator": ["Chandler", "Joey"]},
"Chandler, Joey",
"Chandler,Joey",
id="multiple_creators",
),
# Empty creator list
Expand Down

0 comments on commit 38d982c

Please sign in to comment.