DOC-7013 Add a path-based override rule so RedisVL examples can be staged locally - #3897
Merged
Merged
Conversation
…aged locally `LANGUAGE_TO_CLIENT` has always carried a `'redisvl': 'RedisVL'` entry, but nothing could ever reach it: `get_language_from_extension` maps `.py` to `'python'` unconditionally, and `get_client_name_from_language_and_path` had no path-based override for Python the way it already does for ioredis (`.js`), the three Lettuce variants (`.java`), and Rust-Sync/Rust-Async (`.rs`). Every RedisVL fix therefore had to round-trip through redis-vl-python upstream, with no way to ship a local override in the meantime — the same mechanism `query_vector`'s Node.js/RedisVL clients are the only two examples in that set, so this gap was DOC-6968's reason for declaring `query_vector` out of scope rather than fixing it locally. Added the same shape of path check as the existing ioredis/Lettuce/Rust overrides: `.py` files under a path containing 'redisvl' now resolve to the RedisVL client instead of falling through to Python. Verified with a throwaway file at local_examples/query_vector/redisvl/ (removed before this commit): before the fix, that file's client-name resolution had no path to RedisVL at all; after, `process_local_examples()` correctly overrode the upstream RedisVL entry for `query_vector`, then fell back to the upstream `redis-vl-python` doctest source cleanly once the throwaway file was deleted. Diffed the full before/after examples.json and confirmed no other Python-language entry changed. Learned: this specific unreachable-client gap was the exact reason DOC-6968 declared query_vector's vector3/vector4 out of scope rather than writing a local RedisVL fix — that decision can be revisited now, though the two panes are still CLI-only for the other, independent reasons DOC-6968 documented (no field to filter on, $SHARD_K_RATIO unverifiable outside a cluster) Gaps: no local_examples/*/redisvl/ directory exists yet — this ticket only wires up the mechanism; writing an actual RedisVL local override is separate follow-on work Ticket: DOC-7013
Contributor
Contributor
🧠 Redis MemoryFound 5 related items from repository history (5 new this commit):
Memory updated at e89b02b |
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.
DOC-7013
What
LANGUAGE_TO_CLIENTinbuild/local_examples.pyhas always carried a'redisvl': 'RedisVL'entry, but nothing could ever reach it:.pyfiles always resolve to the'python'language, andget_client_name_from_language_and_pathhad a path-based override for ioredis (.js), the three Lettuce variants (.java), and Rust-Sync/Rust-Async (.rs) — but none for Python. Every RedisVL fix therefore had to round-trip throughredis-vl-pythonupstream, with no way to ship a local override in the meantime.Adds the same shape of override the other clients already have: a
.pyfile whose path containsredisvlnow resolves to theRedisVLclient instead of falling through toPython.Verification
local_examples/query_vector/redisvl/query_vector.py(removed before this commit) and ranbuild/local_examples.py: the log line readProcessing local example: query_vector (python) ... Processed RedisVL example for query_vector, and the resultingdata/examples.jsonentry'ssourcefield pointed at the local file instead of the upstreamredis-vl-pythondoctest.data/examples.jsonis gitignored, so nothing else changed.examples.jsonand confirmed no other Python-language entry (i.e. no plainPythonclient anywhere) was affected by adding this branch.This only wires up the mechanism — no
local_examples/*/redisvl/directory exists yet. Writing an actual RedisVL local override (e.g. forquery_vector'svector3/vector4, which DOC-6968 declared out of scope partly because this gap existed) is separate follow-on work.🤖 Generated with Claude Code
Note
Low Risk
Build-time client labeling in
local_examples.pyonly; no runtime or security-sensitive behavior.Overview
Local example staging now treats Python files like other language-specific overrides: paths containing
redisvlresolve to the RedisVL client inget_client_name_from_language_and_path, instead of always falling through to generic Python.This closes the gap where
LANGUAGE_TO_CLIENTalready mappedredisvl→ RedisVL but no.pypath rule could select it, so RedisVL fixes could not be staged locally until upstreamredis-vl-pythonupdated. No newlocal_examples/*/redisvl/content ships in this PR—only the routing hook.Reviewed by Cursor Bugbot for commit e89b02b. Bugbot is set up for automated code reviews on this repo. Configure here.