Skip to content

Commit 06d4969

Browse files
authored
fix(core): fix zenodo dataset import for datasets with schema:image set (#2142)
1 parent e687b08 commit 06d4969

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

renku/core/commands/providers/zenodo.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,15 @@ def get_jsonld(self):
253253
"""Get record metadata as jsonld."""
254254
response = self._zenodo.accept_jsonld().make_request(self._uri)
255255
self._jsonld = response.json()
256+
257+
if "image" in self._jsonld and isinstance(self._jsonld["image"], str):
258+
self._jsonld["image"] = {
259+
"@id": self._jsonld["image"],
260+
"@type": "ImageObject",
261+
"position": 1,
262+
"contentUrl": self._jsonld["image"],
263+
}
264+
256265
return self._jsonld
257266

258267
def get_files(self):

tests/cli/test_integration_datasets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def test_dataset_import_expected_err(runner, project, doi, err):
199199
[
200200
"https://zenodo.org/record/2621208",
201201
"https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/F4NUMR",
202+
"https://zenodo.org/record/830044",
202203
],
203204
)
204205
@pytest.mark.integration

0 commit comments

Comments
 (0)