Skip to content

Commit 53ad3ca

Browse files
author
Alan Christie
committed
feat: Minor tweak
1 parent 3423c0f commit 53ad3ca

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

workflow/workflow_engine.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,22 +304,22 @@ def _validate_step_command(
304304
# and can be launched. If it is False then the returned str contains an
305305
# error message.
306306
#
307-
# Remember that variables can exist in (ascending order of priority): -
307+
# Remember that variables can exist in the specification too.
308+
# So, the full set of step variables (in ascending order of priority)
309+
# is...
310+
#
308311
# 1. The specification
309312
# 2. The workflow
310-
# 2. The RunningWorkflow
313+
# 3. The RunningWorkflow
311314

312-
all_variables: dict[str, Any] = {}
313-
if "variables" in step_spec:
314-
all_variables = step_spec.pop("variables")
315+
all_variables = step_spec.pop("variables") if "variables" in step_spec else {}
315316
if workflow_variables:
316-
all_variables = all_variables | workflow_variables
317+
all_variables |= workflow_variables
317318
if running_workflow_variables:
318-
all_variables = all_variables | running_workflow_variables
319+
all_variables |= running_workflow_variables
319320
message, success = decode(
320321
job["command"], all_variables, "command", TextEncoding.JINJA2_3_0
321322
)
322-
323323
return all_variables if success else message
324324

325325
def _launch(

0 commit comments

Comments
 (0)