From 04cd8c85a41ede787c64167cbc0b8773b0b62721 Mon Sep 17 00:00:00 2001 From: Bowen Liang Date: Sat, 28 Dec 2024 21:15:11 +0800 Subject: [PATCH] remove bindparams --- api/core/rag/datasource/vdb/tidb_vector/tidb_vector.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/api/core/rag/datasource/vdb/tidb_vector/tidb_vector.py b/api/core/rag/datasource/vdb/tidb_vector/tidb_vector.py index c7e69506db1076..f541ee2e700e31 100644 --- a/api/core/rag/datasource/vdb/tidb_vector/tidb_vector.py +++ b/api/core/rag/datasource/vdb/tidb_vector/tidb_vector.py @@ -4,7 +4,7 @@ import sqlalchemy from pydantic import BaseModel, model_validator -from sqlalchemy import JSON, TEXT, Column, DateTime, Float, Integer, String, Table, bindparam, create_engine, insert +from sqlalchemy import JSON, TEXT, Column, DateTime, String, Table, create_engine, insert from sqlalchemy import text as sql_text from sqlalchemy.orm import Session, declarative_base @@ -216,11 +216,7 @@ def search_by_vector(self, query_vector: list[float], **kwargs: Any) -> list[Doc WHERE distance <= :distance ORDER BY distance ASC LIMIT :top_k - """).bindparams( - bindparam("query_vector_str", type_=String), - bindparam("distance", type_=Float), - bindparam("top_k", type_=Integer), - ) + """) res = session.execute( select_statement, params={