diff --git a/haystack/core/pipeline/pipeline.py b/haystack/core/pipeline/pipeline.py index a97e5dcc56..c863f1f1ce 100644 --- a/haystack/core/pipeline/pipeline.py +++ b/haystack/core/pipeline/pipeline.py @@ -270,12 +270,7 @@ def run( # noqa: PLR0915, PLR0912, C901, pylint: disable=too-many-branches include_outputs_from = pipeline_snapshot.include_outputs_from # also intermediate_outputs from the snapshot when resuming - # keep the deserialization of pipeline_outputs backwards compatible with the old pipeline_outputs format - # TODO: remove this in haystack 2.23.0 - if "serialization_schema" not in pipeline_snapshot.pipeline_state.pipeline_outputs.keys(): - pipeline_outputs = pipeline_snapshot.pipeline_state.pipeline_outputs - else: - pipeline_outputs = _deserialize_value_with_schema(pipeline_snapshot.pipeline_state.pipeline_outputs) + pipeline_outputs = _deserialize_value_with_schema(pipeline_snapshot.pipeline_state.pipeline_outputs) cached_topological_sort = None # We need to access a component's receivers multiple times during a pipeline run. diff --git a/releasenotes/notes/remove-legacy-pipeline-outputs-deserialization-5acccb0245b84890.yaml b/releasenotes/notes/remove-legacy-pipeline-outputs-deserialization-5acccb0245b84890.yaml new file mode 100644 index 0000000000..3b56acae20 --- /dev/null +++ b/releasenotes/notes/remove-legacy-pipeline-outputs-deserialization-5acccb0245b84890.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + Remove backward-compatibility support for deserializing pipeline snapshots with + the old ``pipeline_outputs`` format. Pipeline snapshots created before Haystack 2.22.0 + that contain ``pipeline_outputs`` without the ``serialization_schema`` and ``serialized_data`` + structure are no longer supported. Users should recreate their pipeline snapshots + with the current Haystack version before upgrading to 2.23.0. diff --git a/test/core/pipeline/test_breakpoint.py b/test/core/pipeline/test_breakpoint.py index 36ce453c6e..62f2a9ffd1 100644 --- a/test/core/pipeline/test_breakpoint.py +++ b/test/core/pipeline/test_breakpoint.py @@ -127,37 +127,6 @@ def run(self, input_value: str) -> dict[str, str]: assert loaded_snapshot.break_point.visit_count == 0 -def test_load_pipeline_snapshot_with_old_pipeline_outputs_format(tmp_path): - "Test to ensure backwards compatibility with the old pipeline_outputs format" - # TODO: remove this test in haystack 2.23.0 - pipeline_snapshot = { - "pipeline_state": { - "inputs": { - "serialization_schema": { - "type": "object", - "properties": {"comp2": {"type": "object", "properties": {}}}, - }, - "serialized_data": {"comp2": {}}, - }, - "component_visits": {"comp1": 1, "comp2": 0}, - "pipeline_outputs": {"comp1": {"result": "Answer from comp1"}}, - }, - "break_point": {"component_name": "comp2", "visit_count": 0, "snapshot_file_path": "test_breakpoints"}, - "agent_snapshot": None, - "timestamp": "2025-12-01T17:14:24.366124", - "original_input_data": {"serialization_schema": {"type": "object", "properties": {}}, "serialized_data": {}}, - "ordered_component_names": ["comp1", "comp2"], - "include_outputs_from": ["comp1"], - } - - pipeline_snapshot_file = tmp_path / "old_pipeline_outputs_format.json" - with open(pipeline_snapshot_file, "w") as f: - json.dump(pipeline_snapshot, f) - - loaded_snapshot = load_pipeline_snapshot(pipeline_snapshot_file) - assert loaded_snapshot == PipelineSnapshot.from_dict(pipeline_snapshot) - - class TestCreatePipelineSnapshot: def test_create_pipeline_snapshot_all_fields(self): break_point = Breakpoint(component_name="comp2")