Closed BrentSouza closed 1 year ago
Describe the bug For example, Dynamodb.Client.execute_statement() has a return type ExecuteStatementOutputTypeDef that is defined as:
Dynamodb.Client.execute_statement()
ExecuteStatementOutputTypeDef
ExecuteStatementOutputTypeDef = TypedDict( "ExecuteStatementOutputTypeDef", { "Items": List[Dict[str, TableAttributeValueTypeDef]], "NextToken": str, "ConsumedCapacity": ConsumedCapacityTypeDef, "LastEvaluatedKey": Dict[str, TableAttributeValueTypeDef], "ResponseMetadata": ResponseMetadataTypeDef, }, )
However, execute_statement as returned from the DynamoDB api has a structure like:
execute_statement
{ "Items": [ { "string0": { "S": "string" } }, { "string1": { "SS": ["string0", "string1"] } } ], "LastEvaluatedKey": { "string": { "S": "string" } } }
I believe this is more inline with a type def like:
ExecuteStatementOutputTypeDef = TypedDict( "ExecuteStatementOutputTypeDef", { "Items": List[Dict[str, AttributeValueTypeDef]], "NextToken": str, "ConsumedCapacity": ConsumedCapacityTypeDef, "LastEvaluatedKey": Dict[str, AttributeValueTypeDef], "ResponseMetadata": ResponseMetadataTypeDef, }, )
This is also present with DynamoDB.Client.get_item().
DynamoDB.Client.get_item()
Compare the response in the docs for Client.get_item() vs Table.get_item()
Thank you for the report. I will try to fix it today. This return type should be only used for Table resource.
Table
Fixed in mypy-boto3-dynamodb 1.28.19. Please update and let me know if it works as it should.
mypy-boto3-dynamodb 1.28.19
Describe the bug For example,
Dynamodb.Client.execute_statement()
has a return typeExecuteStatementOutputTypeDef
that is defined as:However,
execute_statement
as returned from the DynamoDB api has a structure like:I believe this is more inline with a type def like:
This is also present with
DynamoDB.Client.get_item()
.Compare the response in the docs for Client.get_item() vs Table.get_item()