Skip to content

Commit

Permalink
Add missing parent span when running cycle in async Pipeline (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanocerza authored Nov 25, 2024
1 parent 6b93e7a commit 63f6876
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion haystack_experimental/core/pipeline/async_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 63f6876

Please sign in to comment.