Repository navigation
Release v2.2.13
Upgrade notes
- Breaking for Rust code that builds
EvaluatorOptionsfield by field.EvaluatorOptions
has a new publiccancelfield (see Added), so a struct literal that lists every field
without..Default::default()no longer compiles. Addcancel: None, or end the literal with
..Default::default(). Strict semver would call this a major change. It ships in a patch
release because jsonata-core's version tracks the jsonata-js version it targets (2.2), and
code that uses..Default::default()is unaffected. The Python and C APIs are unchanged. jsonatapy[mcp]now needs fastmcp 4.1.2 or later, which bringsmcp2.x (see Changed).
Added
- An evaluation can be cancelled from another thread.
EvaluatorOptionshas a new
cancelfield that takes aCancelToken. Callingcancel()on any clone of the token
stops the evaluation withU1003: Evaluation cancelledwherevertimeout_msis checked:
each node evaluated, each element a higher-order builtin hands its callback, each match
$replacehands its replacement function, and each pass of a tail-call loop. A single
builtin call over a large input finishes first, as it does undertimeout_ms, and if it is
the last step the evaluation returns its result. jsonata-js has no cancellation, so the
code is in theUseries. This is a Rust API only. See the upgrade notes above for the
EvaluatorOptionssource break. (#264) Thanks to @jonking-ajar for the design, the
implementation and its tests.
Changed
- The
mcpextra now needs fastmcp 4.1.2 or later (was 3.0). fastmcp 4 bringsmcp2.x
and replaceshttpxwithhttpx2, so an environment that pinsmcp<2or depends on
httpxalongsidejsonatapy[mcp]may need updating. Thejsonatapy mcpserver itself is
unchanged. 4.1.2 is also the first 4.x release with the fix for GHSA-7xgj-8392-5q4r.
Fixed
timeout_msnow stops$map,$filter,$reduce,$single,$sift,$eachand
$sortwhen their callback is a builtin, host or partial function, and$replacewhen its
replacement function is one. Their loops over such a function had no checkpoint, because
the call evaluates no node, so$map(items, $string)over a large array ran to the end past
its timeout. A lambda callback was already stopped, since its body is checked like any node.
An expression withtimeout_msset that used to finish late in one of these loops and
return a result now fails with D1012 instead. (#264) Thanks to @jonking-ajar, who found and
fixed this alongside the cancellation work.
Full commit list: v2.2.12...v2.2.13
Test Suite Compatibility
See the README for the current
reference-suite pass count -- this changelog no longer hardcodes a number here, since a
stale hardcoded count is exactly the kind of bug this project has previously shipped
and had to correct.
Installation
pip install jsonatapy==2.2.13# Cargo.toml
jsonata-core = "2.2.13"Verification
import jsonatapy
print(jsonatapy.__version__) # Should print: 2.2.13