Skip to content

Commit 4582b91

Browse files
committed
The issue was caused by commit a9a7488 which introduced a performance optimization that pre-converts query vectors to bytes format. However, the Redis search client wasn't updated to handle this change and was still trying to convert the already-bytes data to bytes again, causing the ValueError
1 parent 0fa4b2a commit 4582b91

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

engine/clients/redis/search.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,14 @@ def search_one(cls, vector, meta_conditions, top) -> List[Tuple[int, float]]:
8787
.dialect(4)
8888
.timeout(REDIS_QUERY_TIMEOUT)
8989
)
90+
# Handle case where vector is already in bytes format (after commit a9a7488)
91+
if isinstance(vector, bytes):
92+
vec_param = vector
93+
else:
94+
vec_param = np.array(vector).astype(cls.np_data_type).tobytes()
95+
9096
params_dict = {
91-
"vec_param": np.array(vector).astype(cls.np_data_type).tobytes(),
97+
"vec_param": vec_param,
9298
"K": top,
9399
**params,
94100
}

0 commit comments

Comments
 (0)