Skip to content

Commit 5b292db

Browse files
lym953claude
andauthored
fix: correct durable execution statuses to match Python SDK InvocationStatus enum (#793)
SUCCEEDED, FAILED, STOPPED, TIMED_OUT → SUCCEEDED, FAILED, PENDING. STOPPED and TIMED_OUT are OperationStatus values; InvocationStatus only defines SUCCEEDED, FAILED, and PENDING. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 39f48d5 commit 5b292db

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

datadog_lambda/durable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def extract_durable_function_tags(event):
5555
}
5656

5757

58-
VALID_DURABLE_STATUSES = {"SUCCEEDED", "FAILED", "STOPPED", "TIMED_OUT"}
58+
VALID_DURABLE_STATUSES = {"SUCCEEDED", "FAILED", "PENDING"}
5959

6060

6161
def extract_durable_execution_status(response, event):

tests/test_durable.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,19 +131,12 @@ def test_returns_failed(self):
131131
response = {"Status": "FAILED", "Error": "some-error"}
132132
self.assertEqual(extract_durable_execution_status(response, event), "FAILED")
133133

134-
def test_returns_stopped(self):
134+
def test_returns_pending(self):
135135
event = {
136136
"DurableExecutionArn": "arn:aws:lambda:us-east-1:123:function:f:1/durable-execution/n/id"
137137
}
138-
response = {"Status": "STOPPED"}
139-
self.assertEqual(extract_durable_execution_status(response, event), "STOPPED")
140-
141-
def test_returns_timed_out(self):
142-
event = {
143-
"DurableExecutionArn": "arn:aws:lambda:us-east-1:123:function:f:1/durable-execution/n/id"
144-
}
145-
response = {"Status": "TIMED_OUT"}
146-
self.assertEqual(extract_durable_execution_status(response, event), "TIMED_OUT")
138+
response = {"Status": "PENDING"}
139+
self.assertEqual(extract_durable_execution_status(response, event), "PENDING")
147140

148141
def test_returns_none_for_non_durable_event(self):
149142
event = {"key": "value"}

0 commit comments

Comments
 (0)