From 63f6876ba93a236a5a7b96e3f5b5dcce5a5a3621 Mon Sep 17 00:00:00 2001 From: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:20:43 +0100 Subject: [PATCH] Add missing parent span when running cycle in async Pipeline (#140) --- haystack_experimental/core/pipeline/async_pipeline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/haystack_experimental/core/pipeline/async_pipeline.py b/haystack_experimental/core/pipeline/async_pipeline.py index 2270181..16ef293 100644 --- a/haystack_experimental/core/pipeline/async_pipeline.py +++ b/haystack_experimental/core/pipeline/async_pipeline.py @@ -145,6 +145,8 @@ async def _run_subgraph( # noqa: PLR0915, PLR0912 # pylint: disable=too-many-lo cycle: List[str], component_name: str, components_inputs: Dict[str, Dict[str, Any]], + *, + parent_span: Optional[tracing.Span] = None, ) -> AsyncIterator[Tuple[Dict[str, Any], bool]]: """ Runs a `cycle` in the Pipeline starting from `component_name`. @@ -441,7 +443,7 @@ def run(self, word: str): # are run doesn't make a different whether we pick the first or any of the others a # Component is part of. async for subgraph_output, is_final_output in self._run_subgraph( - cycles[0], name, components_inputs + cycles[0], name, components_inputs, parent_span=span ): if not is_final_output: yield subgraph_output