mkio 1.5.0
mkio 1.5.0 moves the expression language to version 2: word operators, in, duration literals, COUNT and function forms of the aggregates. A minor release: every version-1 expression means what it did, since each addition gives meaning to text that was a syntax error. No change to config, the wire protocol, the CLI or the on-disk layout.
Added — language (Python and /mkio-expr.js, pinned by 95 new shared cases)
and,or,not,in,not in, case-insensitive. They are contextual, not reserved: a bare word is an operator only where the grammar had no use for a name, so fields calledinornotparse as they always did.nothas Python's precedence, betweenandand the comparisons, sonot a > bnegates the comparison where!a > bis a type error.x in yisCONTAINS(y, x): member of an array, substring of a string, key of a map, FALSE for NULL. It sits with the comparisons and, like them, does not chain.- Duration literals
500ms 2s 1.5m 1h 1devaluate to seconds, so durations add, scale and compare like any number. COUNT(xs, fn)(withoutfn, the non-NULL elements), and function forms of the aggregates:SUM(trades, t -> t.qty), likewiseAVG,MIN,MAX. The list-only and varargs forms are unchanged.
Added — host tools (Python only)
parse_prefix(text, pos, stop=)parses the one expression that starts attext[pos]and returns it with the offset where it ended, for grammars that embed expressions between their own keywords.stop=["or timeout"]names phrases that end the expression where a word operator would continue it.field_paths(ast)lists every dotted path read from the scope, resolving lambda parameters and LET names (MAP(trades, t -> t.px)readstrades.*.px);check_fields(ast, schema)returns every path the schema does not know. A missing key is NULL at run time, so a misspelt column fails silently; this finds it first.register_library(..., default=False)keeps a library out of every environment that does not name it;Env(extra=[...])adds it to the defaults.
Changed
LANGUAGE_VERSIONmoves from"1"to"2", and the_mkioreply'sexprwith it. The compatibility check comparesexprexactly, as before: a client that asks for language 1 is told it no longer matches. mkui vendors the JavaScript file and the cases and follows in 1.10.0.NOTis refused as a function name, sincenot (x)is the operator.- A plain
pytestnow tests the source tree whatever mkio is installed.
See the README section on the expression language and its generated function tables.