Skip to content

Commit aceb2e4

Browse files
committed
feat!: remove backward compatibility for legacy pipeline_outputs format
Remove temporary deserialization logic for old pipeline_outputs format in pipeline snapshots. This backward-compatibility layer was introduced in PR deepset-ai#10096 and marked for removal in Haystack 2.23.0. BREAKING CHANGE: Pipeline snapshots created before Haystack 2.17.0 will no longer deserialize correctly. Users must recreate snapshots with the current Haystack version or manually migrate to the new serialization schema. Changes: - Remove conditional deserialization check in Pipeline.run() - Remove test_load_pipeline_snapshot_with_old_pipeline_outputs_format test - Add breaking change documentation with migration instructions The new format uses 'serialization_schema' and 'serialized_data' fields, consistent with other pipeline state serialization. Closes deepset-ai#10168 Ref deepset-ai#10096
1 parent 49d1391 commit aceb2e4

3 files changed

Lines changed: 9 additions & 37 deletions

File tree

haystack/core/pipeline/pipeline.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,7 @@ def run( # noqa: PLR0915, PLR0912, C901, pylint: disable=too-many-branches
252252
include_outputs_from = pipeline_snapshot.include_outputs_from
253253

254254
# also intermediate_outputs from the snapshot when resuming
255-
# keep the deserialization of pipeline_outputs backwards compatible with the old pipeline_outputs format
256-
# TODO: remove this in haystack 2.23.0
257-
if "serialization_schema" not in pipeline_snapshot.pipeline_state.pipeline_outputs.keys():
258-
pipeline_outputs = pipeline_snapshot.pipeline_state.pipeline_outputs
259-
else:
260-
pipeline_outputs = _deserialize_value_with_schema(pipeline_snapshot.pipeline_state.pipeline_outputs)
255+
pipeline_outputs = _deserialize_value_with_schema(pipeline_snapshot.pipeline_state.pipeline_outputs)
261256

262257
cached_topological_sort = None
263258
# We need to access a component's receivers multiple times during a pipeline run.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
upgrade:
3+
- |
4+
Remove backward-compatibility support for deserializing pipeline snapshots with
5+
the old ``pipeline_outputs`` format. Pipeline snapshots created before Haystack 2.22.0
6+
that contain ``pipeline_outputs`` without the ``serialization_schema`` and ``serialized_data``
7+
structure are no longer supported. Users should recreate their pipeline snapshots
8+
with the current Haystack version before upgrading to 2.23.0.

test/core/pipeline/test_breakpoint.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -154,37 +154,6 @@ def run(self, input_value: str) -> dict[str, str]:
154154
assert loaded_snapshot.break_point.visit_count == 0
155155

156156

157-
def test_load_pipeline_snapshot_with_old_pipeline_outputs_format(tmp_path):
158-
"Test to ensure backwards compatibility with the old pipeline_outputs format"
159-
# TODO: remove this test in haystack 2.23.0
160-
pipeline_snapshot = {
161-
"pipeline_state": {
162-
"inputs": {
163-
"serialization_schema": {
164-
"type": "object",
165-
"properties": {"comp2": {"type": "object", "properties": {}}},
166-
},
167-
"serialized_data": {"comp2": {}},
168-
},
169-
"component_visits": {"comp1": 1, "comp2": 0},
170-
"pipeline_outputs": {"comp1": {"result": "Answer from comp1"}},
171-
},
172-
"break_point": {"component_name": "comp2", "visit_count": 0, "snapshot_file_path": "test_breakpoints"},
173-
"agent_snapshot": None,
174-
"timestamp": "2025-12-01T17:14:24.366124",
175-
"original_input_data": {"serialization_schema": {"type": "object", "properties": {}}, "serialized_data": {}},
176-
"ordered_component_names": ["comp1", "comp2"],
177-
"include_outputs_from": ["comp1"],
178-
}
179-
180-
pipeline_snapshot_file = tmp_path / "old_pipeline_outputs_format.json"
181-
with open(pipeline_snapshot_file, "w") as f:
182-
json.dump(pipeline_snapshot, f)
183-
184-
loaded_snapshot = load_pipeline_snapshot(pipeline_snapshot_file)
185-
assert loaded_snapshot == PipelineSnapshot.from_dict(pipeline_snapshot)
186-
187-
188157
def test_trigger_tool_invoker_breakpoint(make_pipeline_snapshot_with_agent_snapshot):
189158
pipeline_snapshot_with_agent_breakpoint = make_pipeline_snapshot_with_agent_snapshot(
190159
break_point=AgentBreakpoint("agent", ToolBreakpoint(component_name="tool_invoker"))

0 commit comments

Comments
 (0)