ValidationException: Query condition missed key schema element
Solution 1:
result = self.table.query(
KeyConditionExpression=(Key("PK").eq(where["PK"]) and Key("SK").gt(where["SK"])),
**kwargs,
)
should be
result = self.table.query(
KeyConditionExpression=(Key("PK").eq(where["PK"]) & Key("SK").gt(where["SK"])),
**kwargs,
)
The DynamoDB conditions only support the &
operator and not the and
operator. In fact, it is not possible to overload the and
operator in Python.