UnboundLocalError:赋值前引用的局部变量'key_schema'

时间:2018-05-03 08:50:37

标签: amazon-dynamodb-dax

我试图将DAX与Pynamodb集成(处理现有的拉取请求)。在测试aws DAX sdk的批量写入方法时,我遇到了以下问题。任何帮助表示赞赏。

/.virtualenvs/PynamoDB/lib/python2.7/site-packages/amazondax/DaxClient.pyc in batch_write_item(self, **kwargs)
     98             Stubs.write_batchWriteItem_116217951_1(request, tube)
     99 
--> 100             result = self._decode_result('BatchWriteItem', request, Assemblers.batchWriteItem_116217951_1, tube)
    101             result = self._resolve_attribute_values(result, tube)
    102             return result

/.virtualenvs/PynamoDB/lib/python2.7/site-packages/amazondax/DaxClient.pyc in _decode_result(self, operation_name, request, assembler, tube)
    223         if status == DaxClient.SUCCESS:
    224             tube.skip() #  Throw away the empty error header
--> 225             return assembler(request, tube)
    226         else:
    227             return self._handle_error(operation_name, tube)

/.virtualenvs/PynamoDB/lib/python2.7/site-packages/amazondax/Assemblers.pyc in batchWriteItem_116217951_1(request, tube)
    115 
    116         for _ in range(num_items, 0, -2):
--> 117             key = AttributeValueDecoder._decode_key_bytes(_dec, key_schema)
    118             if _dec.try_decode_null():
    119                 # DeleteRequest

UnboundLocalError: local variable 'key_schema' referenced before assignment

1 个答案:

答案 0 :(得分:1)

这是一个众所周知的问题,我希望很快能解决这个问题。

这已在DAX Python客户端的1.0.4版中修复。