[Python] "The provided key element does not match the schema" error when getting an item from...

Discussão em 'Python' iniciado por Stack, Maio 16, 2025.

  1. Stack

    Stack Membro Participativo

    This is the table partition key setting [​IMG]

    The table content [​IMG]

    When I tried to get an item from the table, it prints this error


    botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the GetItem operation: The provided key element does not match the schema
    ​

    This is my code

    dynamodb = boto3.resource('dynamodb')
    table = dynamodb.Table('testDynamodb')
    response = table.get_item(Key={'userId': "user2873"})
    item = response['Item']
    print(item)


    Any ideas? thanks.

    Continue reading...

Compartilhe esta Página