@@ -75,20 +75,14 @@ def model_exists(project, name, force, versionName="latest"):
75
75
projectId = project ["id" ]
76
76
projectVersions = mr .list_project_versions (project )
77
77
if versionName == "latest" :
78
- # The "latest" option specifies the most recently created version of the project. Search only in that version.
79
78
modTime = [item ["modified" ] for item in projectVersions ]
80
79
latestVersion = modTime .index (max (modTime ))
81
80
versionId = projectVersions [latestVersion ]["id" ]
82
- elif versionName == "new" :
83
- # The "new" option specifies a new project version, so no models with the same name will exist already.
84
- return
85
81
else :
86
- # Otherwise, search for the version name specified. If the version name is not found, produce an error message.
87
82
for version in projectVersions :
88
- if versionName == version ["name" ]:
83
+ if versionName is version ["name" ]:
89
84
versionId = version ["id" ]
90
85
break
91
- ValueError ("No version with the name specified could be found in the project." )
92
86
projectModels = mr .get (
93
87
"/projects/{}/projectVersions/{}/models" .format (projectId , versionId )
94
88
)
@@ -179,9 +173,9 @@ def pzmmImportModel(
179
173
metrics : string list, optional
180
174
The scoring metrics for the model. The default is a set of two
181
175
metrics: EM_EVENTPROBABILITY and EM_CLASSIFICATION.
182
- projectVersion : str , optional
183
- Name of project version to check if a model of the same name already exists. Default
184
- value is " latest" .
176
+ projectVersion : string , optional
177
+ The project version to import the model in to on SAS Model Manager. The default value
178
+ is latest.
185
179
modelFileName : string, optional
186
180
Name of the model file that contains the model. By default None and assigned as
187
181
modelPrefix + '.pickle'.
@@ -315,8 +309,7 @@ def getFiles(extensions):
315
309
model_exists (project , modelPrefix , force , versionName = projectVersion )
316
310
317
311
response = mr .import_model_from_zip (
318
- modelPrefix , project , zipIOFile , force , version = projectVersion
319
-
312
+ modelPrefix , project , zipIOFile , force , projectVersion = projectVersion
320
313
)
321
314
try :
322
315
print (
0 commit comments