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
| Method | Description |
|---|---|
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 | Checks whether the property's string representation contains the given value. |
ends_with | Checks whether the property's string representation ends with the given value. |
first | Selects the first element when the underlying property is list-like. |
fuzzy_search | Performs fuzzy matching against the property's string value. |
is_in | Checks whether the property is contained within the specified iterable of values. |
is_none | Checks whether the property value is None / missing. |
is_not_in | Checks whether the property is not contained within the specified iterable of values. |
is_some | Checks whether the property value is present (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 | Checks whether the property's string representation does not contain the given value. |
starts_with | Checks whether the property's string representation starts with the given value. |
sum | Sums 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
| Name | Type | Default | Description |
|---|---|---|---|
value | Prop | - | Substring that must appear within the value. |
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A filter expression evaluating substring search. |
ends_with
Signature: ends_with(value)
Checks whether the property's string representation ends with the given value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
value | Prop | - | Suffix to check for. |
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A filter expression evaluating suffix matching. |
first
Selects the first element when the underlying property is list-like.
fuzzy_search
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
| Name | Type | Default | Description |
|---|---|---|---|
prop_value | str | - | String to approximately match against. |
levenshtein_distance | int | - | Maximum allowed Levenshtein distance. |
prefix_match | bool | - | Whether to require a matching prefix. |
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A 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
| Name | Type | Default | Description |
|---|---|---|---|
values | list[Prop] | - | Iterable of property values to match against. |
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A filter expression evaluating membership. |
is_none
Checks whether the property value is None / missing.
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A 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
| Name | Type | Default | Description |
|---|---|---|---|
values | list[Prop] | - | Iterable of property values to exclude. |
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A filter expression evaluating non-membership. |
is_some
Checks whether the property value is present (not None).
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A 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
| Name | Type | Default | Description |
|---|---|---|---|
value | Prop | - | Substring that must not appear within the value. |
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A filter expression evaluating substring exclusion. |
starts_with
Signature: starts_with(value)
Checks whether the property's string representation starts with the given value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
value | Prop | - | Prefix to check for. |
Returns
| Type | Description |
|---|---|
filter.FilterExpr | A filter expression evaluating prefix matching. |
sum
Sums list elements when the underlying property is numeric and list-like.