Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Commit 71ff30a

Browse files
committed
Providing an primitive hint T should pass an array of T
(not just convert the array of strings to a string "['value']" haha
1 parent 6d19e63 commit 71ff30a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cwlgen/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def get_required_input_params_for_cls(cls, valuesdict):
120120
argspec = inspect.getargspec(cls.__init__)
121121

122122
args, defaults = argspec.args, argspec.defaults
123-
required_param_keys = set(args[1:-len(defaults)]) if len(defaults) > 0 else args[1:]
123+
required_param_keys = set(args[1:-len(defaults)]) if defaults is not None and len(defaults) > 0 else args[1:]
124124

125125
inspect_ignore_keys = {"self", "args", "kwargs"}
126126
# Params can't shadow the built in 'id', so we'll put in a little hack
@@ -160,6 +160,8 @@ def try_parse_type(value, T):
160160
# if T is a primitive (str, bool, int, float), just return the T representation of retval
161161
elif T in _unparseable_types:
162162
try:
163+
if isinstance(value, list):
164+
return [T(v) for v in value]
163165
return T(value)
164166
except:
165167
return None

cwlgen/workflowdeps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class WorkflowStep(Serializable):
166166
# dict['in'] gets converted to dict['inputs'] as 'in' is a reserved keyword
167167
parse_types = {
168168
"inputs": [[WorkflowStepInput]],
169-
"out": [[WorkflowStepOutput]]
169+
"out": [str, [WorkflowStepOutput]]
170170
}
171171

172172
def __init__(self, step_id, run, label=None, doc=None, scatter=None, scatter_method=None):

0 commit comments

Comments
 (0)