mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-25 11:00:35 +00:00
The DynamoDB GetItem request returns the requested item in a specific way, wrapped in a map with a "Item" member. For historic reasons, we used the same function that returns this (describe_item()) also in other code which reads items - e.g. for checking conditional operations. The result is wasteful - after adding this "Item" member we had other code to extract it, all for no good reason. It is also ugly and confusing. Importantly, this situation also makes it harder for me to add support for FilterExpression. The issue is that the expression evaluator got the item with the wrapper (from the existing ConditionExpression code) but the filtering code had it without this wrapper, as it didn't use describe_item(). So this patch uses describe_single_item(), which doesn't add the wrapper map, instead of describe_item(). The latter function is used just once - to implement GetItem. The unnecessary code to unwrap the item in multiple places was then dropped. All the tests still pass. I also tested test_expected.py in unsafe_rmw write isolation mode, because code only for this mode had to be modified as well. Refs #5038. Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <20200604092050.422092-1-nyh@scylladb.com>