This class proactively merges sub-filters that are combined using the same
operator. For example:
CompositeFilter(AND, [f1, f2, CompositeFilter(AND, [f3, f4]), f5, f6])
is equivalent to:
CompositeFilter(AND, [f1, f2, f3, f4, f5, f6])
Currently filters can only be combined using an AND operator.
Args
op
The operator to use to combine the given filters
filters
A list of one or more filters to combine
Raises
datastore_errors.BadArgumentError if op is not in CompsiteFilter.OPERATORS
or filters is not a non-empty list containing only FilterPredicates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-09-30 UTC."],[[["`CompositeFilter` is an immutable filter predicate used to combine multiple filters."],["It efficiently merges sub-filters that share the same operator, simplifying complex filter structures."],["Currently, filters can only be combined using the `AND` operator."],["The `__call__` method checks if a given entity matches the combined filter predicates."],["It provides methods such as `__eq__` and `__ne__` for comparison."]]],[]]