Specifying Filters As Text¶
There are a few occasions with Metaxy where users may want to define custom filter expressions via text, mainly being CLI arguments or configuration files.
For this purpose, Metaxy implements parse_filter_string, which converts SQL-like WHERE clauses into Narwhals filter expressions.
The following syntax is supported:
-
Comparisons:
=,!=,>,<,>=,<= -
Logical operators:
AND,OR,NOT -
Parentheses for grouping
-
Column references (identifiers or dotted paths)
-
Literals: strings (
'value'), numbers, booleans (TRUE/FALSE), andNULL -
Implicit boolean columns (e.g.,
NOT is_active)
Example usage: