|
70 | 70 |
|
71 | 71 | import logging |
72 | 72 | import sys |
73 | | -from dataclasses import dataclass |
| 73 | +from dataclasses import dataclass, field |
74 | 74 | from typing import Any, Optional |
75 | 75 |
|
76 | 76 | import decoder.decoder as job_definition_decoder |
@@ -117,12 +117,12 @@ class StepPreparationResponse: |
117 | 117 | should contain something useful.""" |
118 | 118 |
|
119 | 119 | replicas: int |
120 | | - variables: dict[str, Any] | None = None |
121 | 120 | replica_variable: str | None = None |
122 | | - replica_values: list[str] | None = None |
123 | | - dependent_instances: set[str] = set() |
124 | | - outputs: set[str] = set() |
125 | | - inputs: set[str] = set() |
| 121 | + variables: dict[str, Any] = field(default_factory=dict) |
| 122 | + replica_values: list[str] = field(default_factory=list) |
| 123 | + dependent_instances: set[str] = field(default_factory=set) |
| 124 | + outputs: set[str] = field(default_factory=set) |
| 125 | + inputs: set[str] = field(default_factory=set) |
126 | 126 | error_num: int = 0 |
127 | 127 | error_msg: str | None = None |
128 | 128 |
|
@@ -217,7 +217,6 @@ def _handle_workflow_start_message(self, r_wfid: str) -> None: |
217 | 217 | sp_resp = self._prepare_step( |
218 | 218 | wf=wf_response, step_definition=first_step, rwf=rwf_response |
219 | 219 | ) |
220 | | - assert sp_resp.variables is not None |
221 | 220 | assert sp_resp.error_msg is None |
222 | 221 | # Launch it. |
223 | 222 | # If there's a launch problem the step (and running workflow) will have |
@@ -392,7 +391,6 @@ def _handle_pod_message(self, msg: PodMessage) -> None: |
392 | 391 | ) |
393 | 392 | return |
394 | 393 |
|
395 | | - assert sp_resp.variables is not None |
396 | 394 | self._launch( |
397 | 395 | rwf=rwf_response, |
398 | 396 | step_definition=next_step, |
@@ -787,7 +785,6 @@ def _launch( |
787 | 785 | assert total_replicas >= 1 |
788 | 786 |
|
789 | 787 | variables = step_preparation_response.variables |
790 | | - assert variables is not None |
791 | 788 | for replica in range(step_preparation_response.replicas): |
792 | 789 |
|
793 | 790 | # If we are replicating this step more than once |
|
0 commit comments