From f9e4d5dc58253cef260dc5e826a5cc585a1c1dd8 Mon Sep 17 00:00:00 2001 From: Madeesh Kannan Date: Thu, 25 Jul 2024 11:58:57 +0200 Subject: [PATCH] chore: Deprecate the `debug` parameter in `Pipeline.run` (#8075) --- haystack/core/pipeline/pipeline.py | 6 ++++-- ...deprecate-pipeline-run-debug-param-e69190338a8e041b.yaml | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/deprecate-pipeline-run-debug-param-e69190338a8e041b.yaml diff --git a/haystack/core/pipeline/pipeline.py b/haystack/core/pipeline/pipeline.py index 0ee88c9b17..fc0d36f1e1 100644 --- a/haystack/core/pipeline/pipeline.py +++ b/haystack/core/pipeline/pipeline.py @@ -48,14 +48,14 @@ def _run_component(self, name: str, inputs: Dict[str, Any]) -> Dict[str, Any]: "haystack.component.input_types": {k: type(v).__name__ for k, v in inputs.items()}, "haystack.component.input_spec": { key: { - "type": value.type.__name__ if isinstance(value.type, type) else str(value.type), + "type": (value.type.__name__ if isinstance(value.type, type) else str(value.type)), "senders": value.senders, } for key, value in instance.__haystack_input__._sockets_dict.items() # type: ignore }, "haystack.component.output_spec": { key: { - "type": value.type.__name__ if isinstance(value.type, type) else str(value.type), + "type": (value.type.__name__ if isinstance(value.type, type) else str(value.type)), "receivers": value.receivers, } for key, value in instance.__haystack_output__._sockets_dict.items() # type: ignore @@ -155,6 +155,8 @@ def run(self, word: str): The pipeline resolves inputs to the correct components, returning {'hello2': {'output': 'Hello, Hello, world!!'}}. """ + warn("The 'debug' parameter is deprecated and will be removed in Haystack 2.5.0.", DeprecationWarning) + pipeline_running(self) # Reset the visits count for each component diff --git a/releasenotes/notes/deprecate-pipeline-run-debug-param-e69190338a8e041b.yaml b/releasenotes/notes/deprecate-pipeline-run-debug-param-e69190338a8e041b.yaml new file mode 100644 index 0000000000..c6a72b8728 --- /dev/null +++ b/releasenotes/notes/deprecate-pipeline-run-debug-param-e69190338a8e041b.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - | + Deprecate the unused `debug` parameter in the `Pipeline.run` method.