Skip to content

Commit c2eb21c

Browse files
author
Alan Christie
committed
refactor: Replicate now uses variable not input
1 parent 2c4c867 commit c2eb21c

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

tests/workflow-definitions/replicate-using-undeclared-input.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ steps:
3232
value: "999"
3333
replicate:
3434
using:
35-
input: y
35+
variable: y
3636
variable-mapping:
3737
- variable: inputFile
3838
from-step:

tests/workflow-definitions/simple-python-fanout.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ steps:
3131
value: "777"
3232
replicate:
3333
using:
34-
input: inputFile
34+
variable: inputFile
3535
variable-mapping:
3636
- variable: inputFile
3737
from-step:

workflow/decoder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,9 @@ def set_step_variables(
200200
return result
201201

202202

203-
def get_step_replication_param(*, step: dict[str, Any]) -> str | Any:
203+
def get_step_replicator(*, step: dict[str, Any]) -> str | Any:
204204
"""Return step's replication info"""
205-
replicator = step.get("replicate", None)
205+
replicator = step.get("replicate")
206206
if replicator:
207207
# 'using' is a dict but there can be only single value for now
208208
replicator = list(replicator["using"].values())[0]

workflow/workflow-schema.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ definitions:
6060
pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
6161

6262
# A step replication control variable
63-
# that is based on a step input variable
64-
replicate-using-input:
63+
# that is based on a step variable
64+
replicate-using-variable:
6565
type: object
6666
additionalProperties: false
6767
properties:
68-
input:
68+
variable:
6969
$ref: '#/definitions/variable-name'
7070
required:
71-
- input
71+
- variable
7272

7373
# A Step variable
7474
# (whose value is derived from a variable used in a prior step)
@@ -174,7 +174,7 @@ definitions:
174174
additionalProperties: false
175175
properties:
176176
using:
177-
$ref: '#/definitions/replicate-using-input'
177+
$ref: '#/definitions/replicate-using-variable'
178178
variable-mapping:
179179
# The map of the source of the step's variables.
180180
# all variables the step needs (that aren;t already in the specification)

workflow/workflow_engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
from .decoder import (
4444
get_step_input_variable_names,
45-
get_step_replication_param,
45+
get_step_replicator,
4646
set_step_variables,
4747
workflow_step_has_outputs,
4848
)
@@ -595,7 +595,7 @@ def _launch(
595595
variables: dict[str, Any] = error_or_variables
596596
print("variables", variables)
597597
# find out if and by which parameter this step should be replicated
598-
replicator = get_step_replication_param(step=step)
598+
replicator = get_step_replicator(step=step)
599599

600600
_LOGGER.info(
601601
"Launching step: RunningWorkflow=%s RunningWorkflowStep=%s step=%s"

workflow/workflow_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _validate_tag_level(
118118
if (
119119
replicate_using_input := step.get("replicate", {})
120120
.get("using", {})
121-
.get("input")
121+
.get("variable")
122122
):
123123
step_name = step["name"]
124124
if replicate_using_input not in get_step_input_variable_names(

0 commit comments

Comments
 (0)