jsonatapy 2.2.14__tar.gz → 2.2.15__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/CHANGELOG.md +180 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/Cargo.lock +1 -113
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/Cargo.toml +1 -2
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/PKG-INFO +4 -4
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/README.md +3 -3
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/pyproject.toml +1 -1
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/ast.rs +44 -1
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/ast_transform.rs +984 -680
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/builtins.rs +192 -21
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/compiler.rs +1 -1
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/datetime.rs +600 -151
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/evaluator.rs +1007 -273
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/functions.rs +37 -17
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/parser.rs +138 -997
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/signature.rs +71 -4
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/evaluator_reuse_test.rs +1 -1
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/path_semantics_combinations.json +393 -1
- jsonatapy-2.2.15/tests/fixtures/path_semantics_combinations_known.json +4 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/integration_test.rs +1036 -12
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/path_semantics_test.rs +0 -5
- jsonatapy-2.2.14/tests/fixtures/path_semantics_combinations_known.json +0 -4
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.gitignore +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.gitmodules +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/.gitignore +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/memories/architecture.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/memories/conventions.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/memories/core.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/memories/memory_maintenance.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/memories/suggested_commands.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/memories/task_completion.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/.serena/memories/tech_stack.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/CONTRIBUTORS.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/LICENSE +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/SECURITY.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/benches/evaluator_bench.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/bindings/c/README.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/bindings/c/examples/smoke.c +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/bindings/c/jsonata.h +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/examples/evaluator_demo.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/examples/host_functions.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/examples/parser_demo.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/examples/simd_json_bench.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/__init__.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/__main__.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/_cli/__init__.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/_cli/bindings.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/_cli/error_format.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/_cli/mcp_server.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/_cli/resolve.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/_cli/run.py +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/python/jsonatapy/py.typed +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/allocator.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/bin/jsonata/bindings.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/bin/jsonata/error_format.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/bin/jsonata/main.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/bin/jsonata/resolve.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/capi.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/expression.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/lazy.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/lib.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/pystack.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/value.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/src/vm.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/study/cli_fixtures.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/study/cli_fixtures_testdata.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/study/cli_spec.md +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/array_flags_test.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/cli_fixtures_test.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/cli_test.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/common/mod.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/datetime_picture_suite.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/deep_value_drop_test.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/array_flags_differential.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/builtin_arity.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/builtin_differential.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/builtin_signatures.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/fastpath_differential.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/fastpath_known_divergences.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/fixtures/path_semantics_differential.json +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/host_functions_test.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/lambda_closure_suite.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/parent_and_focus_binding_suite.rs +0 -0
- {jsonatapy-2.2.14 → jsonatapy-2.2.15}/tests/step_cache_test.rs +0 -0
|
@@ -19,6 +19,186 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
19
19
|
|
|
20
20
|
### Security
|
|
21
21
|
|
|
22
|
+
## [2.2.15] - 2026-11-18
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- **Breaking for Rust users of the AST:** `parser::Parser::parse` now returns the finished
|
|
29
|
+
tree, with ancestry resolved, as `parser::parse` does, and `ast_transform::resolve_ancestry`
|
|
30
|
+
is no longer public. `BinaryOp` has the raw path operators `Map`, `Filter` and `KeepArray`,
|
|
31
|
+
and `AstTransformError` has `Syntax`, so an exhaustive match on either needs the new arms.
|
|
32
|
+
`PathStep` has a `runs_on_nothing` cache field (`StepCache::default()` in a struct literal).
|
|
33
|
+
This doesn't call for a major version: the AST is an internal representation, not a
|
|
34
|
+
supported API. `parse()`, `Expression::compile`, the C API and the Python package are
|
|
35
|
+
unchanged, so the release stays on 2.x.
|
|
36
|
+
- **Less per-call work from the #254 and #260 fixes**
|
|
37
|
+
([#288](https://github.com/txjmb/jsonata-core/issues/288)). The closure that wraps a function
|
|
38
|
+
argument no longer copies the function's parameter names, and whether a step's filters run on
|
|
39
|
+
nothing is worked out the first time the step runs and kept on the step.
|
|
40
|
+
|
|
41
|
+
### Deprecated
|
|
42
|
+
|
|
43
|
+
### Removed
|
|
44
|
+
|
|
45
|
+
- **The `chrono` dependency.** RUSTSEC-2026-0543 marks it unmaintained, with no fixed
|
|
46
|
+
release. The date arithmetic `$fromMillis`, `$toMillis` and `$now` need (UTC calendar
|
|
47
|
+
dates, weekdays, ISO week numbers) is now a small calendar type in `src/datetime.rs`,
|
|
48
|
+
computing on the proleptic Gregorian calendar as JavaScript's `Date` does. Output is
|
|
49
|
+
unchanged except at the edge below.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- **`$now()` and `$millis()` report one timestamp per evaluation, as in jsonata-js**
|
|
54
|
+
([#294](https://github.com/txjmb/jsonata-core/issues/294)). The clock was read on every
|
|
55
|
+
call, so two calls in one expression could disagree.
|
|
56
|
+
- **`$fromMillis` takes the whole range of a JavaScript date**, ±8.64e15 milliseconds
|
|
57
|
+
(years -271821 to 275760). It stopped at chrono's ±262143 years.
|
|
58
|
+
It also takes a fraction of a millisecond, dropping it as JavaScript's `Date` does, where it
|
|
59
|
+
raised "requires an integer".
|
|
60
|
+
- **`$toMillis` returns what jsonata-js does across its edge cases**
|
|
61
|
+
([#295](https://github.com/txjmb/jsonata-core/issues/295)). With a picture, the timestamp is
|
|
62
|
+
built as `Date.UTC` builds it: a field past its range carries into the next (`"2018-02-30"`
|
|
63
|
+
with `"[Y]-[M]-[D]"` is 2 March, hour 24 is the next midnight, month 13 is January of the
|
|
64
|
+
next year), a two-digit year is in the 1900s, a day of the year past the year's end keeps
|
|
65
|
+
the parsed year, and a component of 0 counts as not given when choosing the date and time
|
|
66
|
+
types, as jsonata-js's truthiness test does (so `"0:33 am"` with `"[h]:[m] [P]"` is D3136).
|
|
67
|
+
Components the picture leaves out come from the evaluation's timestamp, and the timezone
|
|
68
|
+
offset is applied in floating point. Without a picture, the timestamp is read as
|
|
69
|
+
`Date.parse` reads it: a day up to 31 carries over, `T24:00:00` is the next midnight, and
|
|
70
|
+
the pattern that decides D3110 is jsonata-js's own. A date past JavaScript's range, a month
|
|
71
|
+
or day of 0, a month over 12 or a day over 31 is NaN, as in jsonata-js (`nan` in Python);
|
|
72
|
+
these were D3136 or D3110. A fraction or a numeric offset with no time is NaN, as
|
|
73
|
+
V8's `Date.parse` gives, except that V8's fallback parser reads `"2018.5"` as 1 May and
|
|
74
|
+
`"2018-01.5"` as 5 January, which are NaN here. A date-time with no offset is still read as
|
|
75
|
+
UTC, where `Date.parse` uses the host's time zone.
|
|
76
|
+
- **Arithmetic checks each operand in jsonata-js's order.** A NaN operand is T2001/T2002
|
|
77
|
+
(`(0/0) + 1` returned undefined), and the left side is checked before the right, so
|
|
78
|
+
`"a" + (1/0)` is T2001 rather than D1001.
|
|
79
|
+
- **`$type` and `$number` on NaN and Infinity match jsonata-js.** `$type` of NaN (such as an
|
|
80
|
+
invalid `$toMillis` date) is `"object"`, and of Infinity is D1001. `$number` returns any
|
|
81
|
+
number as it is, so `$number(1/0)` is Infinity rather than D3030.
|
|
82
|
+
- **Week numbers and day of the year for years 0 to 99 match jsonata-js**, which reads those
|
|
83
|
+
years as 1900 to 1999 when it works them out (`Date.UTC`).
|
|
84
|
+
- **`$encodeUrl` and `$encodeUrlComponent` encode what JavaScript's `encodeURI` and
|
|
85
|
+
`encodeURIComponent` do.** `$encodeUrl("a b")` is `"a%20b"`, where it was `"a b"`: only
|
|
86
|
+
control characters were encoded. `$encodeUrlComponent` no longer encodes `-_.!~*'()`.
|
|
87
|
+
- **`$now(picture, timezone)` formats the time as `$fromMillis` does, as in jsonata-js.** It
|
|
88
|
+
was T0410.
|
|
89
|
+
|
|
90
|
+
- **A `[]` after a group-by on a path keeps the `~>` result an array, as in jsonata-js**
|
|
91
|
+
([#292](https://github.com/txjmb/jsonata-core/issues/292)). `o.b{"k":$}[] ~> $map(f)` is
|
|
92
|
+
`[{"k":1}]`, where it was `{"k":1}`; a `[]` before the group-by (`o.b[]{"k":$}`) still keeps
|
|
93
|
+
nothing there. `$filter` of a single value gives a one-item sequence, as in jsonata-js, so
|
|
94
|
+
`o.b{"k":$}[] ~> $filter(f)` keeps the array too. In the Rust AST, such a `[]` is now a `KeepArray` stage on a one-step path
|
|
95
|
+
around the `ObjectTransform`, not a stage of the path's last step.
|
|
96
|
+
- **A builtin's partial application takes the parameters jsonata-js's function declares**
|
|
97
|
+
([#292](https://github.com/txjmb/jsonata-core/issues/292)). An argument past the builtin's
|
|
98
|
+
parameters is dropped (`$sum(?, 1)` given `[1,2]` is 3, and `$zip(?, [1])` given `[2]` is
|
|
99
|
+
`[[2]]`), and a trailing undefined one isn't passed (`$millis(?)()` and `$now(?)()` give the
|
|
100
|
+
time, where they were T0410). `$string(?)` is S0208, as in jsonata-js, whose `$string`
|
|
101
|
+
declares `prettify = false`, which doesn't parse as a parameter name; it was a function.
|
|
102
|
+
|
|
103
|
+
- **A group-by over a block whose path stops before its tuple step groups once, as in
|
|
104
|
+
jsonata-js** ([#285](https://github.com/txjmb/jsonata-core/issues/285)). jsonata-js enters
|
|
105
|
+
tuple mode only when a path reaches a tuple step, so `(%.b)[%.x]{"k":1}.k` and
|
|
106
|
+
`(nope.b)[%.x]{"k":1}.k` are `1`, where they were undefined, and `nope^(d)#$i{"k":1}` and
|
|
107
|
+
`c[d=9].(nope.b)[%.x]{"k":1}` and `c[d=9].d#$i^($){"k":1}` are `{"k":1}`, where they were `{}`. A path that starts with a sort
|
|
108
|
+
of such a block is a tuple stream, since the sort is a tuple step itself:
|
|
109
|
+
`(nope.b)[%.x]^(x){"k":1}.k` is `{}`, where it was `{"k":1}`.
|
|
110
|
+
|
|
111
|
+
- **A filter or group-by on the call after `~>` is ignored, as in jsonata-js**
|
|
112
|
+
([#286](https://github.com/txjmb/jsonata-core/issues/286)). jsonata-js applies the call and
|
|
113
|
+
never reads its filters or group-by; only `[]` carries over, and a `[]` on the left side or on a
|
|
114
|
+
function value on the right (`$x[] ~> $f`, `x ~> $f[]`) now keeps a single result as an array
|
|
115
|
+
too. With `a` holding `[{"b":"x"},
|
|
116
|
+
{"b":"y"}]`, `a ~> $map(function($v){$v.b})[1]` is now `["x","y"]` (it was `"y"`), `"z" ~>
|
|
117
|
+
$append([1])[0]` is `["z",1]` (it was `"z"`), and `x#$i ~> $count(){"k": $count($)}` is 0 (it
|
|
118
|
+
was T0410). This changes the result of expressions that relied on the filter; to filter the
|
|
119
|
+
result, wrap the chain in parentheses: `(a ~> $map(...))[1]`.
|
|
120
|
+
|
|
121
|
+
- **A `**` step on a missing value runs its filters on nothing, as jsonata-js does**
|
|
122
|
+
([#290](https://github.com/txjmb/jsonata-core/issues/290)). `nope[**[$error("E")]]` is D3137
|
|
123
|
+
and `nope[x[**[1+"a"]]]` is T2002, where both were undefined. A `*` there still runs none.
|
|
124
|
+
A `*` that starts a path runs none on nothing either when more steps follow
|
|
125
|
+
(`*[$error("E")].x` on a string is undefined, where it was D3137).
|
|
126
|
+
|
|
127
|
+
- **A group-by on a step that isn't a path applies where jsonata-js applies it** (stage 3 of
|
|
128
|
+
[#219](https://github.com/txjmb/jsonata-core/issues/219)). On a block, `*` or other node, the
|
|
129
|
+
group now runs inside the step, after the node's predicates and before the step binds its
|
|
130
|
+
focus, index or ancestor: `(objs)@$v{"k": $v.p}.$v` binds `$v` to the grouped object. `#`
|
|
131
|
+
turns the node's predicates into stages applied after the group, so `(objs)[false]{"k": 1}#$j`
|
|
132
|
+
is undefined while `(objs)[false]{"k": 1}` is `{"k": 1}`. A `%` slot left on a step that another
|
|
133
|
+
step follows, or put on a path's last step by a predicate, is never resolved and evaluates to
|
|
134
|
+
nothing, as in jsonata-js, rather than failing with S0217 or resolving against an earlier step
|
|
135
|
+
(`(objs)[%.%.x].p`, `a#$i[%.%.x]`, `a.b{"k": 1}[%.%.a]`). This removes the remaining pinned
|
|
136
|
+
path-semantics divergences. A block whose tail binds nothing (`(%)`, `(*)`, `(%.%)`) gives the
|
|
137
|
+
group plain values, and `#` after predicates on a non-path node still groups as a tuple stream
|
|
138
|
+
(`%[%.x]#$i{"k": 1}` is `{}`).
|
|
139
|
+
|
|
140
|
+
- **Paths are built the way jsonata-js builds them** (stage 2 of
|
|
141
|
+
[#219](https://github.com/txjmb/jsonata-core/issues/219)). The parser uses jsonata-js's binding
|
|
142
|
+
powers for the path operators (`.` 75; `[`, `(`, `@`, `#` 80; group-by `{` 70; sort `^` 40) and
|
|
143
|
+
leaves them as raw nodes, which `ast_transform` resolves in jsonata-js's `processAST` order.
|
|
144
|
+
`-a{...}` and `a = b^(x)` now group as in jsonata-js. Calling something that isn't a function
|
|
145
|
+
(`1()`, `"f"@$v()`, `[1]()`) is T1006 (T1008 for `1(?)`) when the call runs, after its
|
|
146
|
+
arguments, as in jsonata-js (`1($error("x"))` is D3137), not a parse error, so a call of a filtered, sorted or grouped step now evaluates and calling a
|
|
147
|
+
transform (`|x|{"z":1}|($)`) works. Where an expression has more than one path error (S0209,
|
|
148
|
+
S0210, S0213, S0215, S0216, S0217), the one reported is the one jsonata-js raises first, with
|
|
149
|
+
a call's arguments before its procedure: `1.b.2()` and `a[0]@$v(1.b)` are S0213. A second `#`
|
|
150
|
+
on a step without other stages replaces its index (`a#$i#$j`). A `%` predicate (`x[%]`, `x[%[0]]`)
|
|
151
|
+
and a `%` under `#` or `^` (`%#$i`, `%^(x)`) are left unresolved, giving undefined as in
|
|
152
|
+
jsonata-js rather than S0217 or the input. `x ~> $f()#$i` is T2006. S0209, S0210 and S0213
|
|
153
|
+
keep their "Parse error" prefix. Known differences: `#` after `[]` adds an index rather than
|
|
154
|
+
replacing one (`x[]#$i#$j` keeps `$i`); a `[]` after `#` keeps a singleton array that
|
|
155
|
+
jsonata-js unwraps (`acct.o[0]#$i[].id`); and the members of an array or object constructor
|
|
156
|
+
run in order, so the first member's error is reported, where jsonata-js runs them
|
|
157
|
+
concurrently.
|
|
158
|
+
- **Filters on a missing step run as jsonata-js runs them**
|
|
159
|
+
([#260](https://github.com/txjmb/jsonata-core/issues/260)). jsonata-js evaluates the filters
|
|
160
|
+
of a step that gives nothing against `[undefined]`. A computed index of 0 now keeps that
|
|
161
|
+
undefined item, so the next filter runs: `nope[$count([])][$error('E')]` is D3137 and
|
|
162
|
+
`arr.nope[$count([])][$string(1,2,3)]` is T0410 (both were undefined). A predicate that makes
|
|
163
|
+
no call now runs there too when an operator in it can fail its type check without the context:
|
|
164
|
+
`nope[1+'a']` is T2002, `nope[-'a']` D1002, `nope['a'<1]` T2009, `nope[true<1]` T2010,
|
|
165
|
+
`nope[[1..'a']]` T2004, `nope[$$.s+1]` T2001, `nope[{1:2}]` T1003 and
|
|
166
|
+
`nope[{"a":1,"a":2}]` D1009 (all were undefined). The filters of a path in the predicate run
|
|
167
|
+
on nothing too, as before: `nope[x[$error("E")]]` is D3137. Predicates whose operands are all
|
|
168
|
+
paths from the context, such as `nope[price > 5]`, are still skipped. A compiled path step does the same:
|
|
169
|
+
it runs such a filter once on a missing field, so both engines agree. Such a step leaves the
|
|
170
|
+
VM's single-step shortcut for the general compiled path, with no measurable cost
|
|
171
|
+
(`items[$contains(sku,'A')]` over 300,000 items times the same as before).
|
|
172
|
+
- **`$eval` reports an error its expression raises as D3121**, with the inner message (quoted,
|
|
173
|
+
without its code), as jsonata-js does: `$eval('1+"a"')` was T2002. Only unknown functions were wrapped before. The
|
|
174
|
+
engine's own guardrails (timeout D1012, cancellation U1003, depth D1011 and U1001, sequence
|
|
175
|
+
length D2015) keep their codes.
|
|
176
|
+
- **A function passed as an argument of a call runs with a null input**
|
|
177
|
+
([#254](https://github.com/txjmb/jsonata-core/issues/254)). jsonata-js wraps each function
|
|
178
|
+
argument of a call in a closure that applies it with a null input, which a builtin the function
|
|
179
|
+
calls in tail position reads: `($h := function($f){ $f("x") }; $h(function($e){ $eval("a") }))`
|
|
180
|
+
is now undefined (it was 5, the known gap noted under 2.2.12), and
|
|
181
|
+
`($h := function($f){ $f() }; $h($string))` is `"null"`. The wrapper is a partial application
|
|
182
|
+
marked as an argument closure, so the function keeps its arity, and a tail call through one
|
|
183
|
+
still runs in constant stack. A tail call's arguments and the left side of `~>` are not
|
|
184
|
+
wrapped, as in jsonata-js. Inside a path step, `$` in an `$eval` expression is now the eval's
|
|
185
|
+
input rather than the step's item, so this holds there too, and `a.$eval("$", 7)` is 7 for
|
|
186
|
+
each item (it was the item). A partial application of a builtin runs with no input, as
|
|
187
|
+
jsonata-js's does, whether it is called directly or passed as an argument: `($f := $eval(?);
|
|
188
|
+
$f("$"))` and `($h := function($f){ $f("$") }; $h($eval(?)))` are undefined
|
|
189
|
+
([#287](https://github.com/txjmb/jsonata-core/issues/287); they were the input and null). Its
|
|
190
|
+
arguments are checked against the builtin's signature without taking one from the context, so
|
|
191
|
+
`($f := $substring(?, 1); $f(5))` is T0410; jsonata-js doesn't check them at all, and fails
|
|
192
|
+
inside the function (see `docs/compatibility.md`).
|
|
193
|
+
|
|
194
|
+
### Security
|
|
195
|
+
|
|
196
|
+
- `uv.lock`: `dnspython` 2.9.0 → 2.9.2 (CVE-2026-128089) and `opentelemetry-api` 1.45.1 → 1.45.2
|
|
197
|
+
(CVE-2026-126360), clearing the two advisories that failed the scheduled Security Scanning run
|
|
198
|
+
on 2026-11-14. Both are transitive dependencies of the optional `mcp` extra, not of the
|
|
199
|
+
published crate or of the wheel, which has no runtime dependencies. Users of the `mcp` extra
|
|
200
|
+
resolve their own versions and should upgrade both packages.
|
|
201
|
+
|
|
22
202
|
## [2.2.14] - 2026-11-04
|
|
23
203
|
|
|
24
204
|
### Added
|
|
@@ -26,15 +26,6 @@ version = "0.2.21"
|
|
|
26
26
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
27
|
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
|
|
28
28
|
|
|
29
|
-
[[package]]
|
|
30
|
-
name = "android_system_properties"
|
|
31
|
-
version = "0.1.5"
|
|
32
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
-
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
|
34
|
-
dependencies = [
|
|
35
|
-
"libc",
|
|
36
|
-
]
|
|
37
|
-
|
|
38
29
|
[[package]]
|
|
39
30
|
name = "anes"
|
|
40
31
|
version = "0.1.6"
|
|
@@ -238,19 +229,6 @@ dependencies = [
|
|
|
238
229
|
"rand_core",
|
|
239
230
|
]
|
|
240
231
|
|
|
241
|
-
[[package]]
|
|
242
|
-
name = "chrono"
|
|
243
|
-
version = "0.4.45"
|
|
244
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
245
|
-
checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"
|
|
246
|
-
dependencies = [
|
|
247
|
-
"iana-time-zone",
|
|
248
|
-
"js-sys",
|
|
249
|
-
"num-traits",
|
|
250
|
-
"wasm-bindgen",
|
|
251
|
-
"windows-link",
|
|
252
|
-
]
|
|
253
|
-
|
|
254
232
|
[[package]]
|
|
255
233
|
name = "ciborium"
|
|
256
234
|
version = "0.2.2"
|
|
@@ -324,12 +302,6 @@ version = "1.0.5"
|
|
|
324
302
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
325
303
|
checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
|
|
326
304
|
|
|
327
|
-
[[package]]
|
|
328
|
-
name = "core-foundation-sys"
|
|
329
|
-
version = "0.8.7"
|
|
330
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
331
|
-
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
|
|
332
|
-
|
|
333
305
|
[[package]]
|
|
334
306
|
name = "core_detect"
|
|
335
307
|
version = "1.0.0"
|
|
@@ -552,30 +524,6 @@ version = "0.5.0"
|
|
|
552
524
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
553
525
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
554
526
|
|
|
555
|
-
[[package]]
|
|
556
|
-
name = "iana-time-zone"
|
|
557
|
-
version = "0.1.65"
|
|
558
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
559
|
-
checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470"
|
|
560
|
-
dependencies = [
|
|
561
|
-
"android_system_properties",
|
|
562
|
-
"core-foundation-sys",
|
|
563
|
-
"iana-time-zone-haiku",
|
|
564
|
-
"js-sys",
|
|
565
|
-
"log",
|
|
566
|
-
"wasm-bindgen",
|
|
567
|
-
"windows-core",
|
|
568
|
-
]
|
|
569
|
-
|
|
570
|
-
[[package]]
|
|
571
|
-
name = "iana-time-zone-haiku"
|
|
572
|
-
version = "0.1.2"
|
|
573
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
574
|
-
checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f"
|
|
575
|
-
dependencies = [
|
|
576
|
-
"cc",
|
|
577
|
-
]
|
|
578
|
-
|
|
579
527
|
[[package]]
|
|
580
528
|
name = "indexmap"
|
|
581
529
|
version = "2.14.2"
|
|
@@ -620,11 +568,10 @@ dependencies = [
|
|
|
620
568
|
|
|
621
569
|
[[package]]
|
|
622
570
|
name = "jsonata-core"
|
|
623
|
-
version = "2.2.
|
|
571
|
+
version = "2.2.15"
|
|
624
572
|
dependencies = [
|
|
625
573
|
"assert_cmd",
|
|
626
574
|
"base64",
|
|
627
|
-
"chrono",
|
|
628
575
|
"clap",
|
|
629
576
|
"criterion",
|
|
630
577
|
"indexmap",
|
|
@@ -666,12 +613,6 @@ version = "0.12.1"
|
|
|
666
613
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
667
614
|
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
|
|
668
615
|
|
|
669
|
-
[[package]]
|
|
670
|
-
name = "log"
|
|
671
|
-
version = "0.4.33"
|
|
672
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
673
|
-
checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"
|
|
674
|
-
|
|
675
616
|
[[package]]
|
|
676
617
|
name = "memchr"
|
|
677
618
|
version = "2.8.3"
|
|
@@ -1399,65 +1340,12 @@ version = "0.4.0"
|
|
|
1399
1340
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1400
1341
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|
1401
1342
|
|
|
1402
|
-
[[package]]
|
|
1403
|
-
name = "windows-core"
|
|
1404
|
-
version = "0.62.2"
|
|
1405
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1406
|
-
checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
|
|
1407
|
-
dependencies = [
|
|
1408
|
-
"windows-implement",
|
|
1409
|
-
"windows-interface",
|
|
1410
|
-
"windows-link",
|
|
1411
|
-
"windows-result",
|
|
1412
|
-
"windows-strings",
|
|
1413
|
-
]
|
|
1414
|
-
|
|
1415
|
-
[[package]]
|
|
1416
|
-
name = "windows-implement"
|
|
1417
|
-
version = "0.60.2"
|
|
1418
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1419
|
-
checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
|
|
1420
|
-
dependencies = [
|
|
1421
|
-
"proc-macro2",
|
|
1422
|
-
"quote",
|
|
1423
|
-
"syn 2.0.118",
|
|
1424
|
-
]
|
|
1425
|
-
|
|
1426
|
-
[[package]]
|
|
1427
|
-
name = "windows-interface"
|
|
1428
|
-
version = "0.59.3"
|
|
1429
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1430
|
-
checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
|
|
1431
|
-
dependencies = [
|
|
1432
|
-
"proc-macro2",
|
|
1433
|
-
"quote",
|
|
1434
|
-
"syn 2.0.118",
|
|
1435
|
-
]
|
|
1436
|
-
|
|
1437
1343
|
[[package]]
|
|
1438
1344
|
name = "windows-link"
|
|
1439
1345
|
version = "0.2.1"
|
|
1440
1346
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1441
1347
|
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
|
1442
1348
|
|
|
1443
|
-
[[package]]
|
|
1444
|
-
name = "windows-result"
|
|
1445
|
-
version = "0.4.1"
|
|
1446
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1447
|
-
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
|
|
1448
|
-
dependencies = [
|
|
1449
|
-
"windows-link",
|
|
1450
|
-
]
|
|
1451
|
-
|
|
1452
|
-
[[package]]
|
|
1453
|
-
name = "windows-strings"
|
|
1454
|
-
version = "0.5.1"
|
|
1455
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1456
|
-
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
|
|
1457
|
-
dependencies = [
|
|
1458
|
-
"windows-link",
|
|
1459
|
-
]
|
|
1460
|
-
|
|
1461
1349
|
[[package]]
|
|
1462
1350
|
name = "windows-sys"
|
|
1463
1351
|
version = "0.61.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "jsonata-core"
|
|
3
|
-
version = "2.2.
|
|
3
|
+
version = "2.2.15"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
authors = ["txjmb <txjmb@users.noreply.github.com>"]
|
|
6
6
|
description = "High-performance Rust implementation of JSONata query and transformation language"
|
|
@@ -47,7 +47,6 @@ serde_json = { version = "1.0", features = ["preserve_order"] }
|
|
|
47
47
|
thiserror = "2.0"
|
|
48
48
|
regex = "1.12"
|
|
49
49
|
regex-syntax = "0.8"
|
|
50
|
-
chrono = "0.4"
|
|
51
50
|
num-traits = "0.2"
|
|
52
51
|
base64 = "0.23"
|
|
53
52
|
indexmap = "2.2.3"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jsonatapy
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.15
|
|
4
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
5
5
|
Classifier: Intended Audience :: Developers
|
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -75,7 +75,7 @@ Project-URL: Repository, https://github.com/txjmb/jsonata-core
|
|
|
75
75
|
<source media="(prefers-color-scheme: dark)"
|
|
76
76
|
srcset="https://raw.githubusercontent.com/txjmb/jsonata-core/main/docs/assets/realistic-workload-dark.svg">
|
|
77
77
|
<img width="880"
|
|
78
|
-
alt="Realistic-workload benchmark on a 100-product dataset, lower is better: jsonatapy is 8.
|
|
78
|
+
alt="Realistic-workload benchmark on a 100-product dataset, lower is better: jsonatapy is 8.0x faster than the jsonata-js reference on the geometric mean of 5 e-commerce queries, and the pure-Rust jsonata-core engine is faster still."
|
|
79
79
|
src="https://raw.githubusercontent.com/txjmb/jsonata-core/main/docs/assets/realistic-workload-light.svg">
|
|
80
80
|
</picture>
|
|
81
81
|
</a>
|
|
@@ -156,10 +156,10 @@ let result = Evaluator::new().evaluate(&ast, &data)?;
|
|
|
156
156
|
```toml
|
|
157
157
|
# Cargo.toml
|
|
158
158
|
[dependencies]
|
|
159
|
-
jsonata-core = "2.2.
|
|
159
|
+
jsonata-core = "2.2.15" # pure Rust, no Python dependency
|
|
160
160
|
|
|
161
161
|
# Optional: disable SIMD for constrained targets
|
|
162
|
-
jsonata-core = { version = "2.2.
|
|
162
|
+
jsonata-core = { version = "2.2.15", default-features = false }
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
---
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<source media="(prefers-color-scheme: dark)"
|
|
27
27
|
srcset="https://raw.githubusercontent.com/txjmb/jsonata-core/main/docs/assets/realistic-workload-dark.svg">
|
|
28
28
|
<img width="880"
|
|
29
|
-
alt="Realistic-workload benchmark on a 100-product dataset, lower is better: jsonatapy is 8.
|
|
29
|
+
alt="Realistic-workload benchmark on a 100-product dataset, lower is better: jsonatapy is 8.0x faster than the jsonata-js reference on the geometric mean of 5 e-commerce queries, and the pure-Rust jsonata-core engine is faster still."
|
|
30
30
|
src="https://raw.githubusercontent.com/txjmb/jsonata-core/main/docs/assets/realistic-workload-light.svg">
|
|
31
31
|
</picture>
|
|
32
32
|
</a>
|
|
@@ -107,10 +107,10 @@ let result = Evaluator::new().evaluate(&ast, &data)?;
|
|
|
107
107
|
```toml
|
|
108
108
|
# Cargo.toml
|
|
109
109
|
[dependencies]
|
|
110
|
-
jsonata-core = "2.2.
|
|
110
|
+
jsonata-core = "2.2.15" # pure Rust, no Python dependency
|
|
111
111
|
|
|
112
112
|
# Optional: disable SIMD for constrained targets
|
|
113
|
-
jsonata-core = { version = "2.2.
|
|
113
|
+
jsonata-core = { version = "2.2.15", default-features = false }
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
---
|
|
@@ -4,7 +4,7 @@ build-backend = "maturin"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "jsonatapy"
|
|
7
|
-
version = "2.2.
|
|
7
|
+
version = "2.2.15"
|
|
8
8
|
description = "High-performance Python/Rust implementation of JSONata query and transformation language"
|
|
9
9
|
authors = [
|
|
10
10
|
{name = "txjmb", email = "txjmb@users.noreply.github.com"}
|
|
@@ -67,6 +67,39 @@ pub struct PathStep {
|
|
|
67
67
|
/// old step may be evaluated by the same evaluator.
|
|
68
68
|
#[serde(skip)]
|
|
69
69
|
pub id: StepId,
|
|
70
|
+
/// Whether the evaluator runs this step's filters on nothing (#260),
|
|
71
|
+
/// worked out from `stages` the first time the step runs, rather than
|
|
72
|
+
/// each time (#288). A cache, not part of the step's meaning: ignored by
|
|
73
|
+
/// equality and serialization. A clone keeps it, as it keeps `id`, so a
|
|
74
|
+
/// lambda body cloned for each closure doesn't work it out again; code
|
|
75
|
+
/// that changes the `stages` of a step, or of a clone of one, after it
|
|
76
|
+
/// may have run must reset it (`StepCache::default()`), as
|
|
77
|
+
/// `ast_transform` does where it rebuilds stages.
|
|
78
|
+
#[serde(skip)]
|
|
79
|
+
pub runs_on_nothing: StepCache,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/// A value the evaluator works out once from a `PathStep` and keeps on it;
|
|
83
|
+
/// see `PathStep::runs_on_nothing`. Equal to any other, like `StepId`.
|
|
84
|
+
#[derive(Clone, Default)]
|
|
85
|
+
pub struct StepCache(std::sync::OnceLock<bool>);
|
|
86
|
+
|
|
87
|
+
impl StepCache {
|
|
88
|
+
pub(crate) fn get_or_init(&self, init: impl FnOnce() -> bool) -> bool {
|
|
89
|
+
*self.0.get_or_init(init)
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
impl PartialEq for StepCache {
|
|
94
|
+
fn eq(&self, _other: &Self) -> bool {
|
|
95
|
+
true
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
impl std::fmt::Debug for StepCache {
|
|
100
|
+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
101
|
+
write!(f, "StepCache")
|
|
102
|
+
}
|
|
70
103
|
}
|
|
71
104
|
|
|
72
105
|
/// The identity of a path step; see `PathStep::id`. `StepId::default()` is
|
|
@@ -400,9 +433,17 @@ pub enum BinaryOp {
|
|
|
400
433
|
// Binary-node representation as FocusBind (rather than a dedicated
|
|
401
434
|
// `AstNode::IndexBind` struct variant) so the retired `IndexBind`
|
|
402
435
|
// variant has zero remaining construction sites once removed from
|
|
403
|
-
// ast.rs
|
|
436
|
+
// ast.rs. ast_transform's `process_path` resolves it.
|
|
404
437
|
IndexBind,
|
|
405
438
|
|
|
439
|
+
// Raw parse-time path operators, as jsonata-js's parser leaves them for
|
|
440
|
+
// `processAST`: `lhs.rhs` (Map), `lhs[rhs]` (Filter) and `lhs[]`
|
|
441
|
+
// (KeepArray, whose rhs is `Undefined`). ast_transform turns them into
|
|
442
|
+
// `Path` steps and stages; the evaluator never sees them.
|
|
443
|
+
Map,
|
|
444
|
+
Filter,
|
|
445
|
+
KeepArray,
|
|
446
|
+
|
|
406
447
|
// Coalescing
|
|
407
448
|
Coalesce, // ??
|
|
408
449
|
|
|
@@ -435,6 +476,7 @@ impl PathStep {
|
|
|
435
476
|
is_tuple: false,
|
|
436
477
|
inner_tuple: false,
|
|
437
478
|
id: StepId::default(),
|
|
479
|
+
runs_on_nothing: StepCache::default(),
|
|
438
480
|
}
|
|
439
481
|
}
|
|
440
482
|
|
|
@@ -449,6 +491,7 @@ impl PathStep {
|
|
|
449
491
|
is_tuple: false,
|
|
450
492
|
inner_tuple: false,
|
|
451
493
|
id: StepId::default(),
|
|
494
|
+
runs_on_nothing: StepCache::default(),
|
|
452
495
|
}
|
|
453
496
|
}
|
|
454
497
|
}
|