def _get_filter_expression(self, table_name, filters, conditional_operator, name_placeholders, expression_attribute_values):
    '\n        Builds the FilterExpression needed for Query and Scan operations\n        '
    condition_expression = None
    conditional_operator = conditional_operator[CONDITIONAL_OPERATOR]
    for key in sorted(filters.keys()):
        condition = filters[key]
        operator = condition.get(COMPARISON_OPERATOR)
        if (operator not in QUERY_FILTER_VALUES):
            raise ValueError('{0} must be one of {1}'.format(COMPARISON_OPERATOR, QUERY_FILTER_VALUES))
        not_contains = (operator == NOT_CONTAINS)
        operator = FILTER_EXPRESSION_OPERATOR_MAP[operator]
        values = condition.get(ATTR_VALUE_LIST, [])
        condition = self._get_condition(table_name, key, operator, *values)
        if not_contains:
            condition = (~ condition)
        if (condition_expression is None):
            condition_expression = condition
        elif (conditional_operator == AND):
            condition_expression = (condition_expression & condition)
        else:
            condition_expression = (condition_expression | condition)
    return condition_expression.serialize(name_placeholders, expression_attribute_values)
Builds the FilterExpression needed for Query and Scan operations
def _get_filter_expression(self, table_name, filters, conditional_operator, name_placeholders, expression_attribute_values):
    '\n        \n        '
    condition_expression = None
    conditional_operator = conditional_operator[CONDITIONAL_OPERATOR]
    for key in sorted(filters.keys()):
        condition = filters[key]
        operator = condition.get(COMPARISON_OPERATOR)
        if (operator not in QUERY_FILTER_VALUES):
            raise ValueError('{0} must be one of {1}'.format(COMPARISON_OPERATOR, QUERY_FILTER_VALUES))
        not_contains = (operator == NOT_CONTAINS)
        operator = FILTER_EXPRESSION_OPERATOR_MAP[operator]
        values = condition.get(ATTR_VALUE_LIST, [])
        condition = self._get_condition(table_name, key, operator, *values)
        if not_contains:
            condition = (~ condition)
        if (condition_expression is None):
            condition_expression = condition
        elif (conditional_operator == AND):
            condition_expression = (condition_expression & condition)
        else:
            condition_expression = (condition_expression | condition)
    return condition_expression.serialize(name_placeholders, expression_attribute_values)