diff --git a/invenio_rdm_records/resources/serializers/datapackage/schema.py b/invenio_rdm_records/resources/serializers/datapackage/schema.py index 7da1dd09a..02f1d697e 100644 --- a/invenio_rdm_records/resources/serializers/datapackage/schema.py +++ b/invenio_rdm_records/resources/serializers/datapackage/schema.py @@ -30,6 +30,7 @@ class DataPackageSchema(Schema): contributors = fields.Method("get_contributors") def get_keywords(self, obj): + """Get keywords.""" keywords = [] for subject in obj.get("metadata", {}).get("subjects", []): keyword = subject.get("subject") @@ -38,6 +39,7 @@ def get_keywords(self, obj): return keywords if keywords else missing def get_resources(self, obj): + """Get resources.""" resources = [] basepath = obj.get("links", {}).get("self_html") if basepath: @@ -55,6 +57,7 @@ def get_resources(self, obj): return resources def get_licenses(self, obj): + """Get licenses.""" licenses = [] for item in obj.get("metadata", {}).get("rights", []): license = {} @@ -67,6 +70,7 @@ def get_licenses(self, obj): return licenses if licenses else missing def get_contributors(self, obj): + """Get contributors.""" contributors = [] for type in ["creator", "contributor"]: for item in obj.get("metadata", {}).get(f"{type}s", []): diff --git a/invenio_rdm_records/services/schemas/metadata.py b/invenio_rdm_records/services/schemas/metadata.py index 3269b003a..17c17a813 100644 --- a/invenio_rdm_records/services/schemas/metadata.py +++ b/invenio_rdm_records/services/schemas/metadata.py @@ -8,6 +8,7 @@ # it under the terms of the MIT License; see LICENSE file for more details. """RDM record schemas.""" + from functools import partial from urllib import parse