Skip to content

Release v2.2.13

Latest

Choose a tag to compare

@github-actions github-actions released this 24 Oct 16:21
· 1 commit to main since this release

Release v2.2.13

Upgrade notes

  • Breaking for Rust code that builds EvaluatorOptions field by field. EvaluatorOptions
    has a new public cancel field (see Added), so a struct literal that lists every field
    without ..Default::default() no longer compiles. Add cancel: 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 brings mcp 2.x (see Changed).

Added

  • An evaluation can be cancelled from another thread. EvaluatorOptions has a new
    cancel field that takes a CancelToken. Calling cancel() on any clone of the token
    stops the evaluation with U1003: Evaluation cancelled wherever timeout_ms is checked:
    each node evaluated, each element a higher-order builtin hands its callback, each match
    $replace hands its replacement function, and each pass of a tail-call loop. A single
    builtin call over a large input finishes first, as it does under timeout_ms, and if it is
    the last step the evaluation returns its result. jsonata-js has no cancellation, so the
    code is in the U series. This is a Rust API only. See the upgrade notes above for the
    EvaluatorOptions source break. (#264) Thanks to @jonking-ajar for the design, the
    implementation and its tests.

Changed

  • The mcp extra now needs fastmcp 4.1.2 or later (was 3.0). fastmcp 4 brings mcp 2.x
    and replaces httpx with httpx2, so an environment that pins mcp<2 or depends on
    httpx alongside jsonatapy[mcp] may need updating. The jsonatapy mcp server itself is
    unchanged. 4.1.2 is also the first 4.x release with the fix for GHSA-7xgj-8392-5q4r.

Fixed

  • timeout_ms now stops $map, $filter, $reduce, $single, $sift, $each and
    $sort when their callback is a builtin, host or partial function, and $replace when 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 with timeout_ms set 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