Skip to content

Commit 87a9e3f

Browse files
author
Alan Christie
committed
feat: decoder now does not deduplicate workflow variable names
1 parent 1d2dad6 commit 87a9e3f

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

workflow/decoder.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,15 @@ def get_description(definition: dict[str, Any]) -> str | None:
6464

6565
def get_variable_names(definition: dict[str, Any]) -> list[str]:
6666
"""Given a Workflow definition this function returns all the names of the
67-
variables defined at the workflow level."""
68-
wf_variable_names: set[str] = set()
67+
variables defined at the workflow level. This function DOES NOT deduplicate names,
68+
that is the role of the validator."""
69+
wf_variable_names: list[str] = []
6970
variables: dict[str, Any] | None = definition.get("variables")
7071
if variables:
71-
for input_variable in variables.get("inputs", []):
72-
name: str = input_variable["name"]
73-
assert name not in wf_variable_names
74-
wf_variable_names.add(name)
75-
return list(wf_variable_names)
72+
wf_variable_names.extend(
73+
input_variable["name"] for input_variable in variables.get("inputs", [])
74+
)
75+
wf_variable_names.extend(
76+
output_variable["name"] for output_variable in variables.get("outputs", [])
77+
)
78+
return wf_variable_names

0 commit comments

Comments
 (0)