Skip to content

Update Orchestration Ouput Return error #493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion azure/durable_functions/models/OrchestratorState.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
from typing import List, Any, Dict, Optional, Union
from typing import List, Any, Dict, Optional

from azure.durable_functions.models.ReplaySchema import ReplaySchema

Expand Down
10 changes: 10 additions & 0 deletions azure/durable_functions/models/TaskOrchestrationExecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ def get_orchestrator_state_str(self) -> str:
message contains in it the string representation of the orchestration's
state
"""
if(self.output):
try:
# Attempt to serialize the output. If serialization fails, raise an
# error indicating that the orchestration output is not serializable,
# which is not permitted in durable Python functions.
json.dumps(self.output)
except Exception as e:
self.output = None
self.exception = e

state = OrchestratorState(
is_done=self.orchestration_invocation_succeeded,
actions=self.context._actions,
Expand Down