From e89b02b7bdc6152641fa21a3f7fd0ab571278deb Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Fri, 28 Aug 2026 12:40:24 +0100 Subject: [PATCH] DOC-7013 Add a path-based override rule so RedisVL examples can be staged locally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 --- build/local_examples.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/local_examples.py b/build/local_examples.py index 13e4a5ddf1..aa539c5765 100644 --- a/build/local_examples.py +++ b/build/local_examples.py @@ -99,6 +99,10 @@ def get_client_name_from_language_and_path(language: str, path: str, ('using NRedisStack') anywhere in the file content, which matches both the root namespace import and any subnamespace imports (e.g. 'using NRedisStack.Search;'). + For Python (.py) files, override based on path substrings: + - If 'redisvl' in path -> RedisVL + - Otherwise -> Python + Substring checks are case-sensitive and can appear anywhere in the path. """ if language == 'node.js': @@ -116,6 +120,9 @@ def get_client_name_from_language_and_path(language: str, path: str, return 'Rust-Async' if 'rust-sync' in path: return 'Rust-Sync' + if language == 'python': + if 'redisvl' in path: + return 'RedisVL' if language == 'c#': variant = 'Async' if 'async' in path else 'Sync' client = 'NRedisStack' if is_nredisstack_example(content) else 'SE.Redis'