Skip to content

Commit 37dd576

Browse files
committed
Check for .blob attribute for astore
1 parent 0a658c9 commit 37dd576

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Unreleased
33
----------
44
**Improvements**
55
- Added `create_model_version` and `list_model_versions` to `model_repository`
6+
- Added an explicit `ValueError` when attempting to register an ASTORE that can't be downloaded.
67

78
**Bugfixes**
89
- Fixed an issue where `model_repository` did not find models by name once pagination limits were reached.

src/sasctl/utils/astore.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ def create_package_from_astore(table):
2828
sess.loadactionset('astore')
2929

3030
result = sess.astore.describe(rstore=table, epcode=True)
31-
astore = sess.astore.download(rstore=table).blob
31+
astore = sess.astore.download(rstore=table)
32+
if not hasattr(astore, "blob"):
33+
raise ValueError("Failed to download binary data for ASTORE '%s'."
34+
% astore)
35+
astore = astore.blob
36+
3237
astore = bytes(astore) # Convert from SWAT blob type
3338

3439
# Raise error if describe action fails

0 commit comments

Comments
 (0)