-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix jsonToArray on None array #284
Fix jsonToArray on None array #284
Conversation
aad10f6
to
d983841
Compare
Good - not sure what I was thinking with the "if None in data_json...". |
49a8638
to
20c3c6f
Compare
""" | ||
|
||
|
||
def _bytesArrayToList(data): |
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.
This isn't used anywhere else, so I just removed it.
20c3c6f
to
5aaab9e
Compare
5aaab9e
to
b0b7158
Compare
Why do you have the extra parens? e.g. |
Force of habit from working in C. I'll clean those up. |
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.
looks good!
This is the same issue that was partially fixed in #237, where
None
elements in avalue
array caused issues in the helperjsonToArray
. This covers the case where the entirevalue
array isNone
(e.g. an attribute that was created but not written to). It now returns an empty numpy array instead of throwing an exception.This also makes HSDS log the error messages
jsonToArray
produces, and adds a try/except block when doing a bytes decode that can fail.