Skip to content

Commit e9c5541

Browse files
author
Jon Walker
authored
Merge pull request #23 from jameskochubasas/master
Adding CAS table update fix
2 parents cb16335 + a394502 commit e9c5541

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/sasctl/_services/model_management.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ModelManagement(Service):
2020
'performance tasks')
2121

2222
# TODO: set ds2MultiType
23-
def publish_model(self, model, destination, name=None, force=False):
23+
def publish_model(self, model, destination, name=None, force=False, casEndPoint=False):
2424
"""
2525
2626
Parameters
@@ -69,7 +69,11 @@ def publish_model(self, model, destination, name=None, force=False):
6969
# Publishes a model that has already been registered in the model
7070
# repository.
7171
# Unlike model_publish service, does not require Code to be specified.
72-
r = self.post('/publish', json=request, params=dict(force=force),
72+
if casEndPoint:
73+
r = self.post('/publish', json=request, params=dict(force=force,reloadModelTable=True),
74+
headers={'Content-Type': 'application/vnd.sas.models.publishing.request.asynchronous+json'})
75+
else:
76+
r = self.post('/publish', json=request, params=dict(force=force),
7377
headers={'Content-Type': 'application/vnd.sas.models.publishing.request.asynchronous+json'})
7478
return r
7579

src/sasctl/tasks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ def publish_model(model, destination, code=None, max_retries=60,
264264
def submit_request():
265265
# Submit a publishing request
266266
if code is None:
267-
publish_req = mm.publish_model(model, destination,
267+
destType=mp.get_destination(destination).destinationType
268+
if destType == "cas":
269+
publish_req = mm.publish_model(model, destination,
270+
force=replace, casEndPoint=True, **kwargs)
271+
else:
272+
publish_req = mm.publish_model(model, destination,
268273
force=replace, **kwargs)
269274
else:
270275
publish_req = mp.publish_model(model, destination,

0 commit comments

Comments
 (0)