File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -101,11 +101,13 @@ def workflow_clean(document): # type: (MutableMapping[Text, Any]) -> None
101101 step ["in" ] = ins
102102 del step ["inputs" ]
103103 if "scatter" in step :
104- if len (step ["scatter" ]) == 1 :
104+ if isinstance (step ["scatter" ], ( str , Text ) ) == 1 :
105105 step ["scatter" ] = step ["scatter" ][step_id_len :]
106- else :
106+ elif isinstance ( step [ "scatter" ], list ) and len ( step [ "scatter" ]) > 1 :
107107 step ["scatter" ] = [source [step_id_len :] for
108108 source in step ["scatter" ]]
109+ else :
110+ step ["scatter" ] = step ["scatter" ][0 ][step_id_len :]
109111 if "description" in step :
110112 step ["doc" ] = step .pop ("description" )
111113 new_steps [step_id .lstrip ('#' )] = step
@@ -154,7 +156,7 @@ def hints_and_requirements_clean(document):
154156
155157def shorten_type (type_obj ): # type: (List[Any]) -> Union[Text, List[Any]]
156158 """Transform draft-3 style type declarations into idiomatic v1.0 types."""
157- if isinstance (type_obj , Text ) or not isinstance (type_obj , Sequence ):
159+ if isinstance (type_obj , ( str , Text ) ) or not isinstance (type_obj , Sequence ):
158160 return type_obj
159161 new_type = []
160162 for entry in type_obj : # find arrays that we can shorten and do so
You can’t perform that action at this time.
0 commit comments