Skip to content

Commit ec3a831

Browse files
committed
Fix for PYL-W0102: Dangerous default argument
1 parent a66a8c7 commit ec3a831

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/sasctl/pzmm/importModel.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def pzmmImportModel(
121121
inputDF,
122122
targetDF,
123123
predictmethod,
124-
metrics=["EM_EVENTPROBABILITY", "EM_CLASSIFICATION"],
124+
metrics=None,
125125
projectVersion="latest",
126126
modelFileName=None,
127127
pyPath=None,
@@ -171,7 +171,7 @@ def pzmmImportModel(
171171
the format() command.
172172
For example: '{}.predict_proba({})'.
173173
metrics : string list, optional
174-
The scoring metrics for the model. The default is a set of two
174+
The scoring metrics for the model. The default is a list of two
175175
metrics: EM_EVENTPROBABILITY and EM_CLASSIFICATION.
176176
projectVersion : string, optional
177177
The project version to import the model in to on SAS Model Manager. The default value
@@ -201,6 +201,10 @@ def pzmmImportModel(
201201
Model details from an MLFlow model. This dictionary is created by the readMLModelFile function.
202202
By default None.
203203
"""
204+
# Set metrics internal to function call if no value is given
205+
if metrics is None:
206+
metrics = ["EM_EVENTPROBABILITY", "EM_CLASSIFICATION"]
207+
204208
# Initialize no score code or binary H2O model flags
205209
noScoreCode = False
206210
binaryModel = False

src/sasctl/pzmm/writeScoreCode.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def writeScoreCode(
1717
modelPrefix,
1818
predictMethod,
1919
modelFileName,
20-
metrics=["EM_EVENTPROBABILITY", "EM_CLASSIFICATION"],
20+
metrics=None,
2121
pyPath=Path.cwd(),
2222
threshPrediction=None,
2323
otherVariable=False,
@@ -120,6 +120,10 @@ def writeScoreCode(
120120
pickleType : string, optional
121121
Indicator for MLFlow models, which may pickle by non-standard methods. By default 'pickle'.
122122
"""
123+
# Set metrics internal to function call if no value is given
124+
if metrics is None:
125+
metrics = ["EM_EVENTPROBABILITY", "EM_CLASSIFICATION"]
126+
123127
# Check if binary string model
124128
if binaryString is not None:
125129
isBinaryString = True

0 commit comments

Comments
 (0)