|
17 | 17 | import time |
18 | 18 | import traceback |
19 | 19 | from datetime import datetime, timezone |
20 | | -from typing import Any, Dict, Optional, Type, Union |
| 20 | +from typing import Any, Dict, Optional, Tuple, Type, Union |
21 | 21 | from uuid import UUID, uuid4 |
22 | 22 |
|
23 | 23 | from pydantic import BaseModel |
@@ -136,7 +136,9 @@ def initialize(self) -> None: |
136 | 136 | integration_registry.activate_integrations() |
137 | 137 |
|
138 | 138 | # Build parameter model |
139 | | - self._params_model = build_params_model_from_snapshot(self.snapshot, strict=True) |
| 139 | + self._params_model = build_params_model_from_snapshot( |
| 140 | + snapshot=self.snapshot, |
| 141 | + ) |
140 | 142 |
|
141 | 143 | # Initialize orchestrator |
142 | 144 | self._orchestrator = SharedLocalOrchestrator( |
@@ -208,11 +210,12 @@ def execute_pipeline( |
208 | 210 |
|
209 | 211 | placeholder_run: Optional[PipelineRunResponse] = None |
210 | 212 | try: |
211 | | - placeholder_run = self._prepare_execute_with_orchestrator() |
212 | | - |
213 | 213 | # Execute pipeline and get runtime outputs captured internally |
214 | | - captured_outputs = self._execute_with_orchestrator( |
215 | | - placeholder_run, parameters, request.use_in_memory |
| 214 | + placeholder_run, captured_outputs = ( |
| 215 | + self._execute_with_orchestrator( |
| 216 | + resolved_params=parameters, |
| 217 | + use_in_memory=request.use_in_memory, |
| 218 | + ) |
216 | 219 | ) |
217 | 220 |
|
218 | 221 | # Map outputs using fast (in-memory) or slow (artifact) path |
@@ -327,19 +330,17 @@ def _map_outputs( |
327 | 330 |
|
328 | 331 | def _execute_with_orchestrator( |
329 | 332 | self, |
330 | | - placeholder_run: PipelineRunResponse, |
331 | 333 | resolved_params: Dict[str, Any], |
332 | 334 | use_in_memory: bool, |
333 | | - ) -> Optional[Dict[str, Dict[str, Any]]]: |
| 335 | + ) -> Tuple[PipelineRunResponse, Optional[Dict[str, Dict[str, Any]]]]: |
334 | 336 | """Run the snapshot via the orchestrator and return the concrete run. |
335 | 337 |
|
336 | 338 | Args: |
337 | | - placeholder_run: The placeholder run to execute the pipeline on. |
338 | 339 | resolved_params: Normalized pipeline parameters. |
339 | 340 | use_in_memory: Whether runtime should capture in-memory outputs. |
340 | 341 |
|
341 | 342 | Returns: |
342 | | - The in-memory outputs of the pipeline execution. |
| 343 | + A tuple of (placeholder_run, in-memory outputs of the execution). |
343 | 344 |
|
344 | 345 | Raises: |
345 | 346 | RuntimeError: If the orchestrator has not been initialized. |
@@ -400,9 +401,7 @@ def _execute_with_orchestrator( |
400 | 401 | finally: |
401 | 402 | # Always stop deployment runtime context |
402 | 403 | runtime.stop() |
403 | | - |
404 | | - # Store captured outputs for the caller to use |
405 | | - return captured_outputs |
| 404 | + return placeholder_run, captured_outputs |
406 | 405 |
|
407 | 406 | def _execute_init_hook(self) -> None: |
408 | 407 | """Execute init hook if present. |
|
0 commit comments