FilterOps

Builds property filter expressions.

This object represents “a property access” plus optional list/aggregate qualifiers (e.g. first, len, sum) and can emit a filter.FilterExpr via comparisons such as ==, <, is_in, etc.

Returned expressions can be combined with &, |, and ~ at the filter.FilterExpr level (where supported).

Methods

MethodDescription
allRequires that all elements match when the underlying property is list-like.
anyRequires that any element matches when the underlying property is list-like.
avgAverages list elements when the underlying property is numeric and list-like.
containsChecks whether the property's string representation contains the given value.
ends_withChecks whether the property's string representation ends with the given value.
firstSelects the first element when the underlying property is list-like.
fuzzy_searchPerforms fuzzy matching against the property's string value.
is_inChecks whether the property is contained within the specified iterable of values.
is_noneChecks whether the property value is None / missing.
is_not_inChecks whether the property is not contained within the specified iterable of values.
is_someChecks whether the property value is present (not None).
lastSelects the last element when the underlying property is list-like.
lenReturns the list length when the underlying property is list-like.
maxReturns the maximum list element when the underlying property is list-like.
minReturns the minimum list element when the underlying property is list-like.
not_containsChecks whether the property's string representation does not contain the given value.
starts_withChecks whether the property's string representation starts with the given value.
sumSums list elements when the underlying property is numeric and list-like.

Method Details

all

Requires that all elements match when the underlying property is list-like.

any

Requires that any element matches when the underlying property is list-like.

avg

Averages list elements when the underlying property is numeric and list-like.

contains

Signature: contains(value)

Checks whether the property's string representation contains the given value.

Parameters

NameTypeDefaultDescription
valueProp-Substring that must appear within the value.

Returns

TypeDescription
filter.FilterExprA filter expression evaluating substring search.

ends_with

Signature: ends_with(value)

Checks whether the property's string representation ends with the given value.

Parameters

NameTypeDefaultDescription
valueProp-Suffix to check for.

Returns

TypeDescription
filter.FilterExprA filter expression evaluating suffix matching.

first

Selects the first element when the underlying property is list-like.

Signature: fuzzy_search(prop_value, levenshtein_distance, prefix_match)

Performs fuzzy matching against the property's string value.

Uses a specified Levenshtein distance and optional prefix matching.

Parameters

NameTypeDefaultDescription
prop_valuestr-String to approximately match against.
levenshtein_distanceint-Maximum allowed Levenshtein distance.
prefix_matchbool-Whether to require a matching prefix.

Returns

TypeDescription
filter.FilterExprA filter expression performing approximate text matching.

is_in

Signature: is_in(values)

Checks whether the property is contained within the specified iterable of values.

Parameters

NameTypeDefaultDescription
valueslist[Prop]-Iterable of property values to match against.

Returns

TypeDescription
filter.FilterExprA filter expression evaluating membership.

is_none

Checks whether the property value is None / missing.

Returns

TypeDescription
filter.FilterExprA filter expression evaluating value is None.

is_not_in

Signature: is_not_in(values)

Checks whether the property is not contained within the specified iterable of values.

Parameters

NameTypeDefaultDescription
valueslist[Prop]-Iterable of property values to exclude.

Returns

TypeDescription
filter.FilterExprA filter expression evaluating non-membership.

is_some

Checks whether the property value is present (not None).

Returns

TypeDescription
filter.FilterExprA filter expression evaluating value is not None.

last

Selects the last element when the underlying property is list-like.

len

Returns the list length when the underlying property is list-like.

max

Returns the maximum list element when the underlying property is list-like.

min

Returns the minimum list element when the underlying property is list-like.

not_contains

Signature: not_contains(value)

Checks whether the property's string representation does not contain the given value.

Parameters

NameTypeDefaultDescription
valueProp-Substring that must not appear within the value.

Returns

TypeDescription
filter.FilterExprA filter expression evaluating substring exclusion.

starts_with

Signature: starts_with(value)

Checks whether the property's string representation starts with the given value.

Parameters

NameTypeDefaultDescription
valueProp-Prefix to check for.

Returns

TypeDescription
filter.FilterExprA filter expression evaluating prefix matching.

sum

Sums list elements when the underlying property is numeric and list-like.