Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions haystack/core/pipeline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
31 changes: 0 additions & 31 deletions test/core/pipeline/test_breakpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading