Closed mattjala closed 7 months ago
Good - not sure what I was thinking with the "if None in data_json...". Let's keep the HTTP exceptions out of arrayUtil.py. Would prefer the calling function catch ValueError and then raise HTTP... exception as appropriate. Also, could you merge in the latest changes from master?
Why do you have the extra parens? e.g.if (value is None):
vs if value is None:
Why do you have the extra parens? e.g.
if (value is None):
vsif value is None:
Force of habit from working in C. I'll clean those up.
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.