Skip to content

Commit a8dc74c

Browse files
authored
Merge pull request #53 from simvue-io/fix_tenacity
Ensure retries for http posts/puts work
2 parents 3260594 + 663ab5d commit a8dc74c

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change log
22

3+
## v0.9.1
4+
5+
* (Bug fix) Retries in POST/PUTs to REST APIs didn't happen.
6+
* Warn users if `allow_pickle=True` is required.
7+
38
## v0.9.0
49

510
* Set status to `failed` or `terminated` if the context manager is used and there is an exception.

simvue/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def post(url, headers, data, is_json=True):
2828
data = json.dumps(data)
2929
headers = set_json_header(headers)
3030
response = requests.post(url, headers=headers, data=data, timeout=DEFAULT_API_TIMEOUT)
31+
response.raise_for_status()
3132

3233
return response
3334

@@ -41,5 +42,6 @@ def put(url, headers, data, is_json=True, timeout=DEFAULT_API_TIMEOUT):
4142
data = json.dumps(data)
4243
headers = set_json_header(headers)
4344
response = requests.put(url, headers=headers, data=data, timeout=timeout)
45+
response.raise_for_status()
4446

4547
return response

simvue/run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ def save(self, filename, category, filetype=None, preserve_path=False, name=None
557557

558558
if not is_file:
559559
data['pickled'], data['type'] = Serializer().serialize(filename, allow_pickle)
560+
if not data['type'] and not allow_pickle:
561+
self._error('Unable to save Python object, set allow_pickle to True')
560562
data['checksum'] = calculate_sha256(data['pickled'], False)
561563
data['originalPath'] = ''
562564
data['size'] = sys.getsizeof(data['pickled'])

0 commit comments

Comments
 (0)