Operator
lumi_filter.operator
Generic operators for filtering operations.
This module provides generic operator functions for filtering operations that work across different data sources and backends.
generic_ilike_operator(left, right)
Case-insensitive contains operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
left
|
The value to search in |
required | |
right
|
The value to search for |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if right is contained in left (case-insensitive) |
Source code in lumi_filter/operator.py
21 22 23 24 25 26 27 28 29 30 31 |
|
generic_in_operator(left, right)
Generic membership operator.
Checks if left value is a member of right iterable. Falls back to equality check if right is not iterable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
left
|
The value to check for membership |
required | |
right
|
The iterable to check membership in |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if left is in right, otherwise False |
Source code in lumi_filter/operator.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
generic_is_null_operator(left, right)
Generic null check operator for iterables.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
left
|
The value to check for null |
required | |
right
|
String value ('true' or 'false') indicating null check type |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if null check condition is met |
Source code in lumi_filter/operator.py
83 84 85 86 87 88 89 90 91 92 93 94 |
|
generic_like_operator(left, right)
Case-sensitive contains operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
left
|
The value to search in |
required | |
right
|
The value to search for |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
True if right is contained in left (case-sensitive) |
Source code in lumi_filter/operator.py
8 9 10 11 12 13 14 15 16 17 18 |
|
is_null_operator(field, value)
Peewee null check operator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
field
|
The Peewee field to check |
required | |
value
|
String value ('true' or 'false') indicating null check |
required |
Returns:
Type | Description |
---|---|
Peewee expression for null check |
Source code in lumi_filter/operator.py
70 71 72 73 74 75 76 77 78 79 80 |
|
operator_curry(operator_name)
Create a curried operator function for peewee fields.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_name
|
str
|
Name of the operator method to curry |
required |
Returns:
Name | Type | Description |
---|---|---|
function |
Curried operator function |
Source code in lumi_filter/operator.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|