Skip to content

LastEvaluatedKey in QueryOutputTableTypeDef not treated as Optional contrary to boto3 documentation #324

@Ricool06

Description

@Ricool06

Describe the bug
LastEvaluatedKey in QueryOutputTableTypeDef is not treated as Optional by boto3-stubs despite it only being present if a DynamoDB query requires pagination. The documentation for boto3 implies that it is optional here.

Happy to submit a PR, but not 100% sure how the type builder works yet.

To Reproduce
Steps to reproduce the behavior:

  1. Install boto3-stubs[...]
  2. Run mypy on the following code sample
import boto3
from mypy_boto3_dynamodb.type_defs import QueryOutputTableTypeDef

response: QueryOutputTableTypeDef = {
        "Items": [],
        "ConsumedCapacity": {},
        "ResponseMetadata": {
            "RequestId": "",
            "HTTPStatusCode": 200,
            "HTTPHeaders": {},
            "RetryAttempts": 0,
        },
        "Count": 0,
        "ScannedCount": 0,
        # "LastEvaluatedKey": {},
    }

Actual output

 error: Missing key "LastEvaluatedKey" for TypedDict "QueryOutputTableTypeDef"  [typeddict-item]

Expected output

Success: no issues found in 1 source file

Additional context
Ubuntu 20.04, installed with poetry add boto3-stubs, boto3 version 1.34.146.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🎉 releasedChanges were included to the latest release🐞 bugSomething isn't working👋 response neededAwaiting response from a reporter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions