Fix FailureDetails JSON serialization and cut v1.7.2#172
Merged
berndverst merged 1 commit intoJul 9, 2026
Merged
Conversation
Convert task.FailureDetails to a frozen dataclass so failed orchestrations serialize cleanly through the history_export module. Previously FailureDetails was a plain class, so HistoryEvent.to_dict() left it as a raw object and json.dumps raised TypeError for ExecutionCompleted, TaskFailed, SubOrchestrationInstanceFailed, and EntityOperationFailed events. Bump both packages to v1.7.2 and update changelogs.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes a JSON-serialization bug in history export for orchestrations that complete with failure, and prepares the repo for the v1.7.2 release by bumping package versions and updating changelogs.
Changes:
- Converted
task.FailureDetailsinto a frozen dataclass soasdict()recurses correctly andhistory_exportoutput is JSON-serializable. - Added a regression test ensuring failure-bearing events serialize to JSON-safe dictionaries and the full exported document can be
json.loads-parsed. - Bumped
durabletaskanddurabletask.azuremanagedto 1.7.2, updated azuremanaged dependency floors, and updated both changelogs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
durabletask/task.py |
Makes FailureDetails a frozen dataclass to ensure nested history event serialization is JSON-safe. |
tests/durabletask/extensions/history_export/test_serialization.py |
Adds a regression test validating FailureDetails serialization and end-to-end JSON export validity. |
pyproject.toml |
Bumps core package version to 1.7.2. |
durabletask-azuremanaged/pyproject.toml |
Bumps azuremanaged version to 1.7.2 and raises dependency minimums to durabletask>=1.7.2. |
CHANGELOG.md |
Documents the v1.7.2 fix for history export JSON serialization. |
durabletask-azuremanaged/CHANGELOG.md |
Documents the v1.7.2 dependency update. |
berndverst
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where
history_exportfails for any orchestration that completes with an error, and cuts release v1.7.2.task.FailureDetailswas a plain class (not a dataclass), soHistoryEvent.to_dict()(asdict+_to_serializable) left it as a raw object andjson.dumpsraised:This broke
durabletask.extensions.history_exportfor four event types that carry failure information:ExecutionCompletedEventTaskFailedEventSubOrchestrationInstanceFailedEventEntityOperationFailedEventFix
Converted
FailureDetailsto a@dataclass(frozen=True). This is a root-cause fix rather than a per-call-site workaround:message/error_type/stack_traceattributes.asdictnow recurses into it automatically, so all four events serialize to{ "message", "error_type", "stack_trace" }.FailureDetailswas the only non-dataclass, non-primitive nested type in history events; every other nested type (OrchestrationInstance,ParentInstanceInfo,TraceContext) is already a dataclass, so this single change covers the general case.Release v1.7.2
durabletaskanddurabletask.azuremanagedto1.7.2(and updated azuremanaged dependency floors).Tests
test_failure_details_is_json_safeintest_serialization.py.