diff --git a/CHANGELOG.md b/CHANGELOG.md index c9b0bdd7..105760b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log +## v0.9.1 + +* (Bug fix) Retries in POST/PUTs to REST APIs didn't happen. +* Warn users if `allow_pickle=True` is required. + ## v0.9.0 * Set status to `failed` or `terminated` if the context manager is used and there is an exception. diff --git a/simvue/api.py b/simvue/api.py index 435664c4..9a09c06e 100644 --- a/simvue/api.py +++ b/simvue/api.py @@ -28,6 +28,7 @@ def post(url, headers, data, is_json=True): data = json.dumps(data) headers = set_json_header(headers) response = requests.post(url, headers=headers, data=data, timeout=DEFAULT_API_TIMEOUT) + response.raise_for_status() return response @@ -41,5 +42,6 @@ def put(url, headers, data, is_json=True, timeout=DEFAULT_API_TIMEOUT): data = json.dumps(data) headers = set_json_header(headers) response = requests.put(url, headers=headers, data=data, timeout=timeout) + response.raise_for_status() return response diff --git a/simvue/run.py b/simvue/run.py index 5a8dde44..2d0dd4ca 100644 --- a/simvue/run.py +++ b/simvue/run.py @@ -557,6 +557,8 @@ def save(self, filename, category, filetype=None, preserve_path=False, name=None if not is_file: data['pickled'], data['type'] = Serializer().serialize(filename, allow_pickle) + if not data['type'] and not allow_pickle: + self._error('Unable to save Python object, set allow_pickle to True') data['checksum'] = calculate_sha256(data['pickled'], False) data['originalPath'] = '' data['size'] = sys.getsizeof(data['pickled'])