8000 prep for release · teoland/python-sasctl@5bc93c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5bc93c9

Browse files
committed
prep for release
1 parent 159767e commit 5bc93c9

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ Unreleased
33
----------
44
-
55

6+
v1.4.1 (2019-10-17)
7+
-------------------
8+
**Bugfixes**
9+
- Fixed an issue where string inputs to Python models were incorrectly handled by DS2.
10+
611
v1.4 (2019-10-15)
712
-----------------
813
**Changes**

src/sasctl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
55
# SPDX-License-Identifier: Apache-2.0
66

7-
__version__ = '1.4'
7+
__version__ = '1.4.1'
88
__author__ = 'SAS'
99
__credits__ = ['Yi Jian Ching, Lucas De Paula, James Kochuba, Peter Tobac, '
1010
'Chris Toth, Jon Walker']

src/sasctl/utils/pymas/core.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,19 @@ def build_wrapper_function(func, variables, array_input, setup=None,
5959
func = func.__name__ if callable(func) else func
6060

6161
# HELPER: SAS to python char issue where SAS char have spaces and python string does not.
62-
# NOTE: we assume SAS char always need white space to be trimmed. This seems to match python model built so far
63-
pythonStringInput = ('',)
64-
for tmp1 in variables:
65-
if not tmp1.out:
66-
if tmp1.type == 'char':
67-
pythonStringInput = pythonStringInput + (" if " + tmp1.name + ": " + tmp1.name + " = " + tmp1.name + ".strip()",)
62+
# NOTE: we assume SAS char always need white space to be trimmed. This seems to match python model built so far
63+
string_input = ('', )
64+
for v in variables:
65+
if v.type == 'char' and not v.out:
66+
string_input += (" if {0}: {0} = {0}.strip()".format(v.name), )
6867

6968
# Statement to execute the function w/ provided parameters
7069
if array_input:
71-
middle = pythonStringInput +\
70+
middle = string_input +\
7271
(' inputarray = np.array([{}]).reshape((1, -1))'.format(','.join(args)),
73-
' column=[{}]'.format(','.join('"{0}"'.format(w) for w in args)),
72+
' column = [{}]'.format(','.join(str(w) for w in args)),
7473
' import pandas as pd',
75-
' inputrun=pd.DataFrame(data=inputarray, columns=column)',
74+
' inputrun = pd.DataFrame(data=inputarray, columns=column)',
7675
' result = {}(inputrun)'.format(func))
7776
else:
7877
func_call = '{}({})'.format(func, ','.join(args))

0 commit comments

Comments
 (0)
0