-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display publisher as multilang #339
Conversation
elif isinstance(data.get(key), dict): | ||
data[key] = json.dumps(data.get(key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building on what @stefina said above, I think you can move this case to the start of the function and remove one level of the nesting of the logic. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, please check
if isinstance(data.get(key), dict): | ||
data[key] = json.dumps(data.get(key)) | ||
return # exit early since this case is handled | ||
# the key is missing | ||
if not data.get(key): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove this if statement and un-indent everything beneath it by one tab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not do this, actually I would remove
if isinstance(data.get(key), dict):
data[key] = json.dumps(data.get(key))
return
And really validate the missing value here. If we will remove if not data.get(key)
It could lead to overwriting valid data, like str value (from foaf:Organization).
No description provided.