Skip to content

Commit 0e407c5

Browse files
Stu SztukowskiStu Sztukowski
authored andcommitted
Fixed bug where 'import settings' was not added to score code if a Viya connection is not established
1 parent ff30240 commit 0e407c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sasctl/pzmm/write_score_code.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,17 +449,21 @@ def _write_imports(
449449
try:
450450
if current_session().version_info() != 3.5:
451451
cls.score_code += "import settings\n\n"
452+
452453
"""
453454
import settings
454455
455456
456457
"""
458+
457459
except AttributeError:
458460
warn(
459461
"No current session connection was found to a SAS Viya server. Score "
460462
"code will be written under the assumption that the target server is "
461463
"SAS Viya 4."
462464
)
465+
cls.score_code += "import settings\n\n"
466+
463467

464468
if mojo_model or binary_h2o_model:
465469
cls.score_code += "import h2o\n\nh2o.init()\n\n"

0 commit comments

Comments
 (0)