39
39
)
40
40
41
41
from .decoder import (
42
- ReplicationDriver,
43
- ReplicationOrigin,
44
42
Translation,
45
43
get_step_prior_step_variable_mapping,
46
- get_step_replication_driver,
47
44
get_step_workflow_variable_mapping,
48
45
)
49
46
@@ -380,41 +377,20 @@ def _launch(self, *, rwf: dict[str, Any], step: dict[str, Any]) -> None:
380
377
381
378
variables: dict[str, Any] = error_or_variables
382
379
383
- # A replication number,
384
- # use only for steps expected to replicate (even if just once)
380
+ # A step replication number,
381
+ # used only for steps expected to run in parallel (even if just once)
385
382
step_replication_number: int = 0
386
- # Does this step have a replicating driver?
387
- r_driver: ReplicationDriver | None = get_step_replication_driver(step=step)
388
383
replication_values: list[str] = []
389
- if r_driver:
390
- if r_driver.origin == ReplicationOrigin.STEP_VARIABLE:
391
- # We need to get the variable values from a prior step
392
- # We need the prior steps running-workflow-step-id
393
- assert r_driver.source_step_name
394
- response, _ = self._wapi_adapter.get_running_workflow_step_by_name(
395
- name=r_driver.source_step_name,
396
- running_workflow_id=rwf_id,
397
- )
398
- assert "id" in response
399
- o_rwfs_id: str = response["id"]
400
- response, _ = (
401
- self._wapi_adapter.get_running_workflow_step_output_values_for_output(
402
- running_workflow_step_id=o_rwfs_id,
403
- output_variable=r_driver.source_variable,
404
- )
405
- )
406
- assert "output" in response
407
- replication_values = response["output"]
408
- else:
409
- assert False, "Unsupported origin"
384
+ source_is_splitter: bool = False
385
+ iter_variable: str | None = None
410
386
411
387
num_step_instances: int = max(1, len(replication_values))
412
388
for iteration in range(num_step_instances):
413
389
414
390
# If we are replicating this step then we must replace the step's variable
415
391
# with a value expected for this iteration.
416
- if r_driver :
417
- iter_variable: str = r_driver.variable
392
+ if source_is_splitter :
393
+ assert iter_variable
418
394
iter_value: str = replication_values[iteration]
419
395
_LOGGER.info(
420
396
"Replicating step: %s iteration=%s variable=%s value=%s",
@@ -424,7 +400,7 @@ def _launch(self, *, rwf: dict[str, Any], step: dict[str, Any]) -> None:
424
400
iter_value,
425
401
)
426
402
# Over-write the replicating variable
427
- # and set the replication numebr to a unique +ve non-zero value...
403
+ # and set the replication number to a unique +ve non-zero value...
428
404
variables[iter_variable] = iter_value
429
405
step_replication_number = iteration + 1
430
406
0 commit comments