From 0e407c53777a0a0a70d77d6084996f692e959fd0 Mon Sep 17 00:00:00 2001 From: Stu Sztukowski Date: Wed, 10 Jan 2024 20:04:54 -0500 Subject: [PATCH] Fixed bug where 'import settings' was not added to score code if a Viya connection is not established --- src/sasctl/pzmm/write_score_code.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sasctl/pzmm/write_score_code.py b/src/sasctl/pzmm/write_score_code.py index 970a81ac..565abe2e 100644 --- a/src/sasctl/pzmm/write_score_code.py +++ b/src/sasctl/pzmm/write_score_code.py @@ -449,17 +449,21 @@ def _write_imports( try: if current_session().version_info() != 3.5: cls.score_code += "import settings\n\n" + """ import settings """ + except AttributeError: warn( "No current session connection was found to a SAS Viya server. Score " "code will be written under the assumption that the target server is " "SAS Viya 4." ) + cls.score_code += "import settings\n\n" + if mojo_model or binary_h2o_model: cls.score_code += "import h2o\n\nh2o.init()\n\n"