@@ -17,10 +17,10 @@ class _OrchestratorBase(abc.ABC):
17
17
18
18
def __init__ (
19
19
self ,
20
- pipeline_spec : Dict [str , Any ],
20
+ pipeline_defn : Dict [str , Any ],
21
21
step_handlers : Dict [str , _StepHandlerBase ],
22
22
):
23
- self ._pipeline_spec = pipeline_spec
23
+ self ._pipeline_defn = pipeline_defn
24
24
self ._step_handlers = step_handlers
25
25
26
26
# DAG nodes are step names
@@ -30,13 +30,13 @@ def __init__(
30
30
31
31
@staticmethod
32
32
def _get_predecessors_mapping (
33
- pipeline_spec : Dict [str , Any ],
33
+ pipeline_defn : Dict [str , Any ],
34
34
) -> Dict [str , List [str ]]:
35
35
"""Get the names of steps' predecessors from a pipeline specification.
36
36
37
37
Parameters
38
38
----------
39
- pipeline_spec : dict
39
+ pipeline_defn : dict
40
40
Pipeline specification.
41
41
42
42
Returns
@@ -45,14 +45,14 @@ def _get_predecessors_mapping(
45
45
Mapping from step names to their predecessors' names.
46
46
47
47
"""
48
- return {node ["name" ]: node ["inputs " ] for node in pipeline_spec ["graph" ]}
48
+ return {node ["name" ]: node ["predecessors " ] for node in pipeline_defn ["graph" ]}
49
49
50
50
def _prepare_pipeline (self ):
51
51
"""Initialize ``self._dag`` and ``self._outputs``.
52
52
53
53
Parameters
54
54
----------
55
- pipeline_spec : dict
55
+ pipeline_defn : dict
56
56
Pipeline specification.
57
57
58
58
Raises
@@ -61,7 +61,7 @@ def _prepare_pipeline(self):
61
61
If the pipeline graph has cycles.
62
62
63
63
"""
64
- dag = TopologicalSorter (self ._get_predecessors_mapping (self ._pipeline_spec ))
64
+ dag = TopologicalSorter (self ._get_predecessors_mapping (self ._pipeline_defn ))
65
65
dag .prepare ()
66
66
# TODO: assert one input node
67
67
# TODO: assert one output node
@@ -201,7 +201,7 @@ class LocalOrchestrator(_OrchestratorBase):
201
201
----------
202
202
conn : :class:`~verta._internal_utils._utils.Connection`
203
203
Verta client connection.
204
- pipeline_spec : dict
204
+ pipeline_defn : dict
205
205
Pipeline specification.
206
206
207
207
Examples
@@ -210,34 +210,34 @@ class LocalOrchestrator(_OrchestratorBase):
210
210
211
211
from verta._pipeline_orchestrator import LocalOrchestrator
212
212
213
- orchestrator = LocalOrchestrator(client._conn, pipeline_spec )
213
+ orchestrator = LocalOrchestrator(client._conn, pipeline_defn )
214
214
pipeline_output = orchestrator.run(pipeline_input)
215
215
216
216
"""
217
217
218
218
def __init__ (
219
219
self ,
220
220
conn : _utils .Connection ,
221
- pipeline_spec : Dict [str , Any ],
221
+ pipeline_defn : Dict [str , Any ],
222
222
):
223
223
super ().__init__ (
224
- pipeline_spec = pipeline_spec ,
225
- step_handlers = self ._init_step_handlers (conn , pipeline_spec ),
224
+ pipeline_defn = pipeline_defn ,
225
+ step_handlers = self ._init_step_handlers (conn , pipeline_defn ),
226
226
)
227
227
228
228
@classmethod
229
229
def _init_step_handlers (
230
230
cls ,
231
231
conn : _utils .Connection ,
232
- pipeline_spec : Dict [str , Any ],
232
+ pipeline_defn : Dict [str , Any ],
233
233
) -> Dict [str , ModelObjectStepHandler ]:
234
234
"""Instantiate and return step handlers.
235
235
236
236
Parameters
237
237
----------
238
238
conn : :class:`~verta._internal_utils._utils.Connection`
239
239
Verta client connection.
240
- pipeline_spec : dict
240
+ pipeline_defn : dict
241
241
Pipeline specification.
242
242
243
243
Returns
@@ -246,10 +246,10 @@ def _init_step_handlers(
246
246
Mapping of step names to their handlers.
247
247
248
248
"""
249
- predecessors_mapping = cls ._get_predecessors_mapping (pipeline_spec )
249
+ predecessors_mapping = cls ._get_predecessors_mapping (pipeline_defn )
250
250
251
251
step_handlers = dict ()
252
- for step in pipeline_spec ["steps" ]:
252
+ for step in pipeline_defn ["steps" ]:
253
253
step_handlers [step ["name" ]] = ModelObjectStepHandler (
254
254
name = step ["name" ],
255
255
predecessors = predecessors_mapping .get (step ["name" ], []),
0 commit comments