

def delete_item(self):
    name = self.body['TableName']
    key = self.body['Key']
    hash_key = key['HashKeyElement']
    range_key = key.get('RangeKeyElement')
    return_values = self.body.get('ReturnValues', '')
    item = dynamodb_backend.delete_item(name, hash_key, range_key)
    if item:
        if (return_values == 'ALL_OLD'):
            item_dict = item.to_json()
        else:
            item_dict = {
                'Attributes': [],
            }
        item_dict['ConsumedCapacityUnits'] = 0.5
        return dynamo_json_dump(item_dict)
    else:
        er = 'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'
        return self.error(er)

dataset/ETHPy150Open spulec/moto/moto/dynamodb/responses.py DynamoHandler.delete_item/original