Repository navigation
[MOD-19414] Add pathParseNoErrorMsg to the RedisJSON LLAPI (V10) - #1666
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1666 +/- ##
==========================================
+ Coverage 88.22% 88.25% +0.03%
==========================================
Files 17 17
Lines 6063 6073 +10
==========================================
+ Hits 5349 5360 +11
+ Misses 714 713 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Itzikvaknin
suggested changes
Oct 11, 2026
Itzikvaknin
reviewed
Oct 12, 2026
Itzikvaknin
approved these changes
Oct 12, 2026
AvivDavid23
approved these changes
Oct 12, 2026
This was referenced Oct 12, 2026
Merged
2 of 4 tasks
AvivDavid23
pushed a commit
that referenced
this pull request
Nov 11, 2026
…1693) * [MOD-17021] Add getWithPath LLAPI to evaluate a pre-compiled JSONPath (#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) * [MOD-19414] Add pathParseNoErrorMsg to the RedisJSON LLAPI (V10) (#1666) (cherry picked from commit 4635c87) * Drop unused get_llapi_ctx import that fails clippy on 8.10 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]> --------- Co-authored-by: Claude Opus 4.8 <[email protected]> Co-authored-by: Dimitar Kyurtov <[email protected]>
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.
Compile JSON paths without a Redis context or error string
Search's JSON loader path cache discards parse errors, but the existing
pathParseAPI requires a Redis context and an error-message output parameter. AddpathParseNoErrorMsg(const char *path)to the V10 LLAPI so callers can compile a path and receive a handle orNULLwithout allocating a Redis error string.The new entry preserves
pathParsesemantics, including rejection of invalid UTF-8, malformed paths, and computed/projection expressions. Successful handles work with the existing path-property functions,getWithPath, andpathFree. Both API version constants advance to 10; the new field is appended after V9 without changing existing entries.Validation
redis_jsontests withas-librarypassed. Coverage includes path properties, result parity, reuse across documents, and parse failures.Note
Medium Risk
Extends the stable C shared-API layout and version binding; existing V9 consumers are unaffected, but modules that assume API v9 must bind v10 to use the new field.
Overview
RedisJSON LLAPI v10 adds
pathParseNoErrorMsg, which compiles a JSONPath string into a handle (orNULL) without aRedisModuleCtxor error-string output—matchingpathParserejection rules for bad UTF-8, invalid syntax, and projection/computed paths.The new function pointer is appended to the shared
RedisJSONAPIstruct (Rust export macro,rejson_api.h, and version constant 9 → 10). Handles from either parser work with existingpathFree, path metadata, andgetWithPath. The LLAPI test module and pytest/Rust tests cover success parity withpathParseand silent failure on invalid paths.Reviewed by Cursor Bugbot for commit b6185a1. Bugbot is set up for automated code reviews on this repo. Configure here.