From cf9a75a73e0c2ff254893a4bc23bbecf2b67935c Mon Sep 17 00:00:00 2001 From: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:11:49 +0200 Subject: [PATCH] Remove deprecated Pipeline init argument debug_path (#8424) --- haystack/core/pipeline/base.py | 22 ++----------------- .../remove-debug-path-68e9b2e41d7d43fd.yaml | 4 ++++ 2 files changed, 6 insertions(+), 20 deletions(-) create mode 100644 releasenotes/notes/remove-debug-path-68e9b2e41d7d43fd.yaml diff --git a/haystack/core/pipeline/base.py b/haystack/core/pipeline/base.py index a2c0306dee..c31f02ba64 100644 --- a/haystack/core/pipeline/base.py +++ b/haystack/core/pipeline/base.py @@ -4,7 +4,6 @@ import importlib import itertools -import warnings from collections import defaultdict from copy import copy, deepcopy from datetime import datetime @@ -50,20 +49,13 @@ class PipelineBase: Builds a graph of components and orchestrates their execution according to the execution graph. """ - def __init__( - self, - metadata: Optional[Dict[str, Any]] = None, - debug_path: Optional[Union[Path, str]] = None, - max_runs_per_component: int = 100, - ): + def __init__(self, metadata: Optional[Dict[str, Any]] = None, max_runs_per_component: int = 100): """ Creates the Pipeline. :param metadata: Arbitrary dictionary to store metadata about this `Pipeline`. Make sure all the values contained in this dictionary can be serialized and deserialized if you wish to save this `Pipeline` to file. - :param debug_path: - When debug is enabled in `run()`, where to save the debug data. :param max_runs_per_component: How many times the `Pipeline` can run the same Component. If this limit is reached a `PipelineMaxComponentRuns` exception is raised. @@ -73,15 +65,6 @@ def __init__( self._last_telemetry_sent: Optional[datetime] = None self.metadata = metadata or {} self.graph = networkx.MultiDiGraph() - self._debug: Dict[int, Dict[str, Any]] = {} - if debug_path is None: - self._debug_path = Path(".haystack_debug/") - else: - warnings.warn( - "The 'debug_path' argument is deprecated and will be removed in version '2.7.0'.", DeprecationWarning - ) - self._debug_path = Path(debug_path) - self._max_runs_per_component = max_runs_per_component def __eq__(self, other) -> bool: @@ -162,8 +145,7 @@ def from_dict( data_copy = deepcopy(data) # to prevent modification of original data metadata = data_copy.get("metadata", {}) max_runs_per_component = data_copy.get("max_runs_per_component", 100) - debug_path = Path(data_copy.get("debug_path", ".haystack_debug/")) - pipe = cls(metadata=metadata, max_runs_per_component=max_runs_per_component, debug_path=debug_path) + pipe = cls(metadata=metadata, max_runs_per_component=max_runs_per_component) components_to_reuse = kwargs.get("components", {}) for name, component_data in data_copy.get("components", {}).items(): if name in components_to_reuse: diff --git a/releasenotes/notes/remove-debug-path-68e9b2e41d7d43fd.yaml b/releasenotes/notes/remove-debug-path-68e9b2e41d7d43fd.yaml new file mode 100644 index 0000000000..046a4ece02 --- /dev/null +++ b/releasenotes/notes/remove-debug-path-68e9b2e41d7d43fd.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Removed `Pipeline` init argument `debug_path`. We do not support this anymore.