From 1fedadc9f3365fd292ba168c47ce4e1d72179a16 Mon Sep 17 00:00:00 2001 From: Raymond Ehlers Date: Sun, 18 Aug 2019 18:10:30 -0400 Subject: [PATCH] Fix loading numpy array The defaults changed for newer version of numpy, so we explicitly allow pickle when loading to successfully load arrays --- pachyderm/yaml.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pachyderm/yaml.py b/pachyderm/yaml.py index 0d610df..be7ac18 100644 --- a/pachyderm/yaml.py +++ b/pachyderm/yaml.py @@ -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],