0
votes

I am getting the following error in python 3, boto 3 while doing a query in dynamoDB table.

Attribute object fundName is of type . KeyConditionExpression only supports Attribute objects of type Key

I am getting an Error on this line of code

response = table.query(KeyConditionExpression=Attr("fundName").eq(key))

fundName is my primary key of the dynamoDB table and I want to get the exact row of data. Can some one please help in guiding where am I wrong.

1

1 Answers

1
votes

The error message is telling me that you need a Key attribute rather than Attr one, if that makes sense.

Try:

response = table.query(KeyConditionExpression=Key("fundName").eq(key))