我尝试从 Dynamo DB 表获取项目,但最终收到错误消息。尝试使用 boto3 资源和客户端,但没有成功。任何帮助将不胜感激。
表中accountId为PK,comState为SK。
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('table_abc')
response = table.get_item(Key={'accountId': 'ACC123',
'comState':'STARTED'})
items = response.get('Item', None)
我收到以下错误消息。
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the
GetItem operation: The provided key element does not match the schema
Captured logging:
INFO:botocore.tokens:Loading cached SSO token for default