HTypeError: unhashable type: 'collections.OrderedDict' issue in amazon-dax-client==2.0.0

32 views Asked by At

I am facing TypeError: unhashable type: 'collections.OrderedDict' while getting data from DAX client.

Version - amazon-dax-client==2.0.0 , python 3.8.7

please find this stacktrace: GetItemIssue, batch_keys:{'beauty_mapping_details': {'Keys': [{'id': '123'}, {'id': '345'}, {'id': '556'}, {'id': '777'}, {'id': '111'}]}} tableName:beauty_mapping_details Traceback (most recent call last): File "/home/ubuntu/pds_script/sharedutils/dynamodbutils.py", line 81, in batch_get_item response = self.dynamo_client.batch_get_item(RequestItems=batch_keys, File "/home/ubuntu/.local/lib/python3.8/site-packages/boto3/resources/factory.py", line 520, in do_action response = action(self, *args, **kwargs) File "/home/ubuntu/.local/lib/python3.8/site-packages/boto3/resources/action.py", line 83, in call response = getattr(parent.meta.client, operation_name)(*args, **params) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/AmazonDaxClient.py", line 209, in batch_get_item return self._read_request('batch_get_item', **kwargs) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/AmazonDaxClient.py", line 255, in _read_request return self._retryable_request(rclient, op_name, **kwargs) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/AmazonDaxClient.py", line 274, in _retryable_request raise e File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/AmazonDaxClient.py", line 267, in _retryable_request response = self._do_request(action, op_name, **kwargs) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/AmazonDaxClient.py", line 306, in _do_request response = action(**api_params) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/DaxClient.py", line 86, in batch_get_item result = self._resolve_attribute_values(result, tube) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/DaxClient.py", line 465, in _resolve_attribute_values self._resolve_item_attribute_values(item, tube) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/DaxClient.py", line 479, in _resolve_item_attribute_values AttributeValueDecoder.deanonymize_attribute_values(item, attr_names) File "/home/ubuntu/.local/lib/python3.8/site-packages/amazondax/AttributeValueDecoder.py", line 32, in deanonymize_attribute_values values = dict(zip(attr_names, attr_values)) TypeError: unhashable type: 'collections.OrderedDict'

I have tried to reproduce it on testing but failed to do that. But the same has been occurred on prod. Please help me to resolve this issue. Athough, we have same dependency and all but issue is with prod env not with testing one.

0

There are 0 answers