You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resuming a pipeline from a snapshot file turns int dict keys into strings #13492
Currently, _save_pipeline_snapshot saves the snapshot with json.dump, which writes int keys as JSON strings, and the saved schema records only the values' types, so the resumed component gets '1' where the run had 1. Resuming from the in-memory e.pipeline_snapshot keeps the int keys.
Expected behavior
The resume returns {'sink': {'v': {1: 'a', 2: 'b'}}}, the same as a run without the breakpoint.
Additional context
A snapshot saved when a run fails does the same. Float, bool and None keys come back as '1.5', 'true' and 'null', and {1: 'a', '1': 'b'} as {'1': 'b'}.
To Reproduce
importosos.environ["HAYSTACK_PIPELINE_SNAPSHOT_SAVE_ENABLED"] ="true"fromhaystackimportPipeline, componentfromhaystack.core.errorsimportBreakpointExceptionfromhaystack.core.pipeline.breakpointimportload_pipeline_snapshotfromhaystack.dataclasses.breakpointsimportBreakpoint@componentclassSrc:
@component.output_types(v=dict[int, str])defrun(self):
return {"v": {1: "a", 2: "b"}}
@componentclassSink:
@component.output_types(v=dict[int, str])defrun(self, v: dict[int, str]):
return {"v": v}
p=Pipeline()
p.add_component("src", Src())
p.add_component("sink", Sink())
p.connect("src.v", "sink.v")
try:
p.run({}, break_point=Breakpoint("sink", snapshot_file_path="snapshots"))
exceptBreakpointExceptionase:
print(p.run({}, pipeline_snapshot=load_pipeline_snapshot(e.pipeline_snapshot_file_path)))
# {'sink': {'v': {'1': 'a', '2': 'b'}}}, should be {'sink': {'v': {1: 'a', 2: 'b'}}}# the docs say the JSON snapshot has "the same information as in the BreakpointException"
Fix opened in #13497: dicts with non-string keys in snapshot payloads are now serialized as explicit key/value entries (each key keeps its own schema), so dict[int, str] values survive a snapshot-file round-trip with their key types intact. String-keyed dicts keep the existing properties format unchanged, and snapshots written before this change still load as before. Includes the issue's end-to-end repro as a regression test plus JSON round-trip unit tests.
Activity
rupak-eng commentedon Oct 30, 2026
Fix opened in #13497: dicts with non-string keys in snapshot payloads are now serialized as explicit key/value entries (each key keeps its own schema), so
dict[int, str]values survive a snapshot-file round-trip with their key types intact. String-keyed dicts keep the existingpropertiesformat unchanged, and snapshots written before this change still load as before. Includes the issue's end-to-end repro as a regression test plus JSON round-trip unit tests.