Skip to content

Commit

Permalink
chore: fix missing docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Dec 9, 2024
1 parent f4ddb41 commit 8c0a267
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
Expand All @@ -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 = {}
Expand All @@ -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", []):
Expand Down
1 change: 1 addition & 0 deletions invenio_rdm_records/services/schemas/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8c0a267

Please sign in to comment.