Repository navigation
[8.10] Backport getWithPath (V9) and pathParseNoErrorMsg (V10) LLAPI - #1693
Merged
AvivDavid23 merged 3 commits intoNov 11, 2026
Merged
Conversation
…RedisJSON#1623) * MOD-16899: add getWithPath LLAPI to evaluate a pre-compiled JSONPath Adds a V9 RedisJSON C API entry getWithPath(json, JSONPath) that evaluates an already-compiled path (from pathParse) instead of a path string, skipping the per-call pest compilation. Callers that resolve the same path across many documents (e.g. RediSearch FT.AGGREGATE LOAD) can compile once and reuse the handle. - c_api.rs: json_api_get_with_path + exported JSONAPI_getWithPath, struct/initializer entry, REDIS_JSONAPI_LATEST_API_VER 8->9; parity unit test (getWithPath == get). - include/rejson_api.h: getWithPath declaration + LATEST_API_VER bump. lib.rs: register the entrypoint. Co-Authored-By: Claude Opus 4.8 <[email protected]> * MOD-16899: add LLAPI flow test for getWithPath Extend the llapi_test_module consumer with LLAPI.OPEN_GET_WITH_PATH (pathParse + getWithPath, via an open_and_get_with_path helper mirroring open_and_get, sharing reply_nodes_as_json with OPEN_GET) and assert in test_llapi.py that it matches LLAPI.OPEN_GET, plus missing-key / bad-path / projection error cases. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: reject projections at runtime like json_api_get Replace the debug_assert with 'if query.is_projection() { return null(); }' so a projection path is handled identically to the string-based json_api_get in all builds (not just debug), and defensively at the FFI boundary. Add a unit test passing a compiled projection Query directly. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: trim projection comments Drop the self-explanatory test doc comment and shorten the guard comment to a one-liner referencing json_api_get. Co-Authored-By: Claude Opus 4.8 <[email protected]> * getWithPath: drop json_api_get reference from projection guard comment Co-Authored-By: Claude Opus 4.8 <[email protected]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> (cherry picked from commit 628013e)
…isJSON#1666) (cherry picked from commit 4635c87)
Since the pre-command hook became optional, export_shared_api! imports get_llapi_ctx itself, so the top-level import is unused and `cargo clippy -- -D warnings` fails on 8.10. Matches master. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.10 #1693 +/- ##
==========================================
+ Coverage 85.80% 85.89% +0.08%
==========================================
Files 15 15
Lines 5249 5288 +39
==========================================
+ Hits 4504 4542 +38
- Misses 745 746 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AvivDavid23
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports two LLAPI additions onto 8.10 as separate commits, in order:
getWithPath(json, JSONPath): evaluate a pre-compiledpathParsehandle instead of re-parsing the path string on every call.pathParseNoErrorMsg(const char *path): compile a path without a Redis context or error-string output.RedisJSONAPI_LATEST_API_VERgoes 8 → 10. TheRedisJSONAPIstruct layout for V1–V10 is identical to master's, so a consumer built against master's header binds the same slots on 8.10. Master's V11 entries are not part of this backport.One adaptation in the #1623 commit: on 8.10 (after #1653) the pre-command hook is optional in
export_shared_api!, soJSONAPI_getWithPathuses the optional$(pre_command: …)?form. That is the form it has on master. The verbatim pick fails to compile withvariable 'pre_command_function_expr' is still repeating at this depth. #1666 applied cleanly.A third commit drops an unused
get_llapi_ctximport fromlib.rs. It is not part of either backport: base 8.10 already failscargo clippy --release -- -D warningson it, becauseexport_shared_api!imports the function itself now that the hook is optional. Master has the same removal.Validation (local, macOS):
cargo fmt -- --check,cargo test --all,cargo test -p redis_json --features as-library,cargo build --releaseall pass.tests/pytest/test_llapi.py: 20/20 pass, includingtestLLAPIOpenGetWithPath,testLLAPIOpenGetWithPathErrors, andtestLLAPIPathParseNoErrorMsg.Mark if applicable
Release Notes
New LLAPI entries
getWithPath(evaluate a pre-compiled JSONPath, avoiding repeated path parsing) andpathParseNoErrorMsg(compile a JSONPath without a Redis context or error string).🤖 Generated with Claude Code
Note
Medium Risk
Extends the versioned public C ABI (new struct tail fields); correct for consumers binding
RedisJSON_V10, with thread-safety constraints on reused path handles.Overview
Backports two RedisJSON shared C API (LLAPI) entries onto this branch and bumps
RedisJSONAPI_LATEST_API_VERfrom 8 to 10 in Rust andrejson_api.h, wiring them intoRedisJSONAPI/RedisJSONAPI_CURRENTand the exportedJSONAPI_*shims.V9
getWithPathevaluates a document against a pre-compiledJSONPathfrompathParseorpathParseNoErrorMsg, avoiding re-parsing on each read; projection paths still return null, matching string-basedget. Callers must not use the same compiled handle concurrently across threads.V10
pathParseNoErrorMsgcompiles a path without a Redis context or error string—invalid, UTF-8-bad, or projection paths return null.The LLAPI pytest consumer gains
LLAPI.OPEN_GET_WITH_PATHandLLAPI.PATHPARSE_NO_ERROR_MSG, with Rust unit tests and Python flow tests asserting parity withOPEN_GET/PATHPARSEand error behavior.Reviewed by Cursor Bugbot for commit 9b345fe. Bugbot is set up for automated code reviews on this repo. Configure here.