Open taesungh opened 6 hours ago
Hello!
Thank you for the report. Unfortunately, there is no way to check totality of output shapes. However, it is possible to override a type parsed from botocore
shapes and provide a union of potential output TypedDicts
.
You could help me by writing all possible DescribeExecution...OutputTypeDef
s here in a comment. Let me know if you are interested in adding an override for SFN.Client.describe_execution
return type as a PR.
The response of DescribeExecution in AWS Step Functions can vary based on the status of the given execution.
The current output type
DescribeExecutionOutputTypeDef
(forSFN.Client.describe_execution
) specifies all items as required which is partly contradictory.Example query and potential responses
```python { "executionArn": "arn:...", "stateMachineArn": "arn:...", "name": "...", "status": "RUNNING", "startDate": datetime.datetime(...), "input": '{...}', "inputDetails": {"included": True}, "redriveCount": 0, "redriveStatus": "NOT_REDRIVABLE", "redriveStatusReason": "Execution is RUNNING and cannot be redriven", "ResponseMetadata": { ... }, } ```For status
RUNNING
```python { "executionArn": "arn:...", "stateMachineArn": "arn:...", "name": "...", "status": "SUCCEEDED", "startDate": datetime.datetime(...), "stopDate": datetime.datetime(...), "input": '{...}', "inputDetails": {"included": True}, "output": '{...}', "outputDetails": {"included": True}, "redriveCount": 0, "redriveStatus": "NOT_REDRIVABLE", "redriveStatusReason": "Execution is SUCCEEDED and cannot be redriven", "ResponseMetadata": { ... }, } ```For status
SUCCEEDED
```python { "executionArn": "arn:...", "stateMachineArn": "arn:...", "name": "...", "status": "FAILED", "startDate": datetime.datetime(...), "stopDate": datetime.datetime(...), "input": '{...}', "inputDetails": {"included": True}, "traceHeader": "...", "error": "Error", "cause": "...", "redriveCount": 0, "redriveStatus": "REDRIVABLE", "ResponseMetadata": { ... }, } ```For status
FAILED
```python { "executionArn": "arn:...", "stateMachineArn": "arn:...", "name": "...", "status": "TIMED_OUT", "startDate": datetime.datetime(...), "stopDate": datetime.datetime(...), "input": '{...}', "inputDetails": {"included": True}, "traceHeader": "...", "redriveStatus": "NOT_REDRIVABLE", "redriveStatusReason": "Execution's redrivable period has ended", "ResponseMetadata": { ... }, } ```For status
TIMED_OUT
```python { "executionArn": "arn:...", "stateMachineArn": "arn:...", "name": "...", "status": "ABORTED", "startDate": datetime.datetime(...), "stopDate": datetime.datetime(...), "input": '{...}', "inputDetails": {"included": True}, "traceHeader": "...", "redriveStatus": "REDRIVABLE", "ResponseMetadata": { ... }, } ```For status
ABORTED
And there is also status
PENDING_REDRIVE
for which I don't have an example.Resolution
It would be great if this builder could produce a union of narrowed variants although it may be difficult to account for all possible scenarios. Otherwise, marking certain fields as
NotRequired
would suffice. Specifically, it appearsstopDate
,output
,outputDetails
,error
,cause
,traceHeader
, andredriveStatusReason
are all possibly not included in the response along withmapRunArn
,redriveDate
,stateMachineAliasArn
, andstateMachineVersionArn
.Additional context
Referencing mypy-boto3-stepfunctions v1.35.46