Skip to content

Commit fcaaf00

Browse files
DCO Remediation Commit for samyarpotlapalli <[email protected]>I, samyarpotlapalli <[email protected]>, hereby add my Signed-off-by to this commit: c01034e23bd6bd9c3905648223b6d784f68e0693I, samyarpotlapalli <[email protected]>, hereby add my Signed-off-by to this commit: b6078ce3560dcbe18cff09737491861f82d37f78I, samyarpotlapalli <[email protected]>, hereby add my Signed-off-by to this commit: d32a9c4a26513d4a36d9ce45fa2d511ba5cc6f73Signed-off-by: samyarpotlapalli <[email protected]>
1 parent 47ad7b3 commit fcaaf00

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/sasctl/_services/model_management.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def publish_model(
4444
The name or id of the model, or a dictionary representation of the model.
4545
destination : str
4646
Name of destination to publish the model to.
47-
model_version_id : str or dict, optional
48-
Provide the id, name, or dictionary representation of the version to publish. Defaults to 'latest'.
47+
model_version : str or dict, optional
48+
Provide the version id, name, or dict to publish. Defaults to 'latest'.
4949
name : str, optional
5050
Provide a custom name for the published model. Defaults to None.
5151
force : bool, optional
@@ -164,7 +164,7 @@ def create_performance_definition(
164164
multiple models, input a list of model names, or a list of dictionaries. If no models are specified, all
165165
models in the project specified will be used. Defaults to None.
166166
modelVersions: str, list, optional
167-
The name of the model version(s). Defaults to None, where all models are latest.
167+
The name of the model version(s). Defaults to None, i.e. all models are latest.
168168
library_name : str
169169
The library containing the input data, default is 'Public'.
170170
name : str, optional
@@ -322,7 +322,7 @@ def create_performance_definition(
322322
@classmethod
323323
def check_model_versions(cls, models, modelVersions):
324324
"""
325-
Checking if the model version(s) are valid. Appending them to the model_id accordingly.
325+
Checking if the model version(s) are valid and append to model id accordingly.
326326
327327
Parameters
328328
----------
@@ -337,38 +337,38 @@ def check_model_versions(cls, models, modelVersions):
337337
"""
338338
if not modelVersions:
339339
return [model.id for model in models]
340-
else:
341-
updated_models = []
342-
if not isinstance(modelVersions, list):
343-
modelVersions = [modelVersions]
344340

345-
if len(models) < len(modelVersions):
346-
raise ValueError(
347-
"There are too many versions for the amount of models specified."
348-
)
341+
updated_models = []
342+
if not isinstance(modelVersions, list):
343+
modelVersions = [modelVersions]
349344

350-
modelVersions = modelVersions + [""] * (len(models) - len(modelVersions))
351-
for model, modelVersionName in zip(models, modelVersions):
345+
if len(models) < len(modelVersions):
346+
raise ValueError(
347+
"There are too many versions for the amount of models specified."
348+
)
352349

353-
if (
354-
isinstance(modelVersionName, dict)
355-
and "modelVersionName" in modelVersionName
356-
):
350+
modelVersions = modelVersions + [""] * (len(models) - len(modelVersions))
351+
for model, modelVersionName in zip(models, modelVersions):
357352

358-
modelVersionName = modelVersionName["modelVersionName"]
359-
elif (
360-
isinstance(modelVersionName, dict)
361-
and "modelVersionName" not in modelVersionName
362-
):
353+
if (
354+
isinstance(modelVersionName, dict)
355+
and "modelVersionName" in modelVersionName
356+
):
363357

364-
raise ValueError("Model version is not recognized.")
358+
modelVersionName = modelVersionName["modelVersionName"]
359+
elif (
360+
isinstance(modelVersionName, dict)
361+
and "modelVersionName" not in modelVersionName
362+
):
365363

366-
if modelVersionName != "":
367-
updated_models.append(model.id + ":" + modelVersionName)
368-
else:
369-
updated_models.append(model.id)
364+
raise ValueError("Model version is not recognized.")
365+
366+
if modelVersionName != "":
367+
updated_models.append(model.id + ":" + modelVersionName)
368+
else:
369+
updated_models.append(model.id)
370370

371-
return updated_models
371+
return updated_models
372372

373373
@classmethod
374374
def execute_performance_definition(cls, definition):

0 commit comments

Comments
 (0)