Skip to content

Commit

Permalink
chore: fix missing docstrings
Browse files Browse the repository at this point in the history
slint committed Dec 9, 2024

Verified

This commit was signed with the committer’s verified signature.
slint Alex Ioannidis
1 parent f4ddb41 commit 8c0a267
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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", []):
1 change: 1 addition & 0 deletions invenio_rdm_records/services/schemas/metadata.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8c0a267

Please sign in to comment.