Skip to content

Commit

Permalink
Fix loading numpy array
Browse files Browse the repository at this point in the history
The defaults changed for newer version of numpy, so we explicitly allow
pickle when loading to successfully load arrays
  • Loading branch information
raymondEhlers committed Aug 18, 2019
1 parent 235f41f commit 1fedadc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pachyderm/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ def numpy_from_yaml(constructor: Constructor, data: ruamel.yaml.nodes.SequenceNo
else:
# Binary encoded numpy. Decode and load it.
b = data.value.encode("utf-8")
return_value = np.load(BytesIO(base64.decodebytes(b)))
# Requires explicitly allowing pickle to load arrays. This used to be default
# True, so our risk hasn't changed.
return_value = np.load(BytesIO(base64.decodebytes(b)), allow_pickle = True)
return return_value

def enum_to_yaml(cls: Type[T_EnumToYAML],
Expand Down

0 comments on commit 1fedadc

Please sign in to comment.