Closed flolas closed 11 months ago
Thanks for the feature request, definitely would like to support this for both query and scan. The tricky part will be running validation / parsing on the keys while ignoring all of the other fields. I'll try to get something out this week.
@flolas This is supported in 0.12.0
. You can pass load_full_item=True
to automatically refresh and get the full item. I haven't tested with INCLUDE projection indexes, but it should also work in that case.
given a Example Table with secondary index that ha projection_type = 'KEYS_ONLY':
when you get the results from dynamodb only return the
__hash_key__
because of projection_type, this raises an error when calling the query() method becausesome_required_attribute
is missing.You can make optional all the fields to make this work, but I think that is a bad idea when using schema validation, lol.
Feature Idea: When querying secondary indexes with KEYS_ONLYS projection would be great to: (1) disable the validation of the pydantic schema upon getting the data and validate only keys and return the object with the partion keys only. (2) [optional argument for query] query method return the full object using GET operations after getting (1)