Skip to content

Commit 243eb2e

Browse files
authored
fix: Add back ujson in the requirements (#744)
* fix: Add back ujson in the requirements * fix the coding style Signed-off-by: yangxuan <xuan.yang@zilliz.com>
1 parent 7e251b6 commit 243eb2e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ dependencies = [
3939
"environs",
4040
"pydantic<v2",
4141
"scikit-learn",
42-
"pymilvus", # with pandas, numpy, ujson
42+
"pymilvus", # with pandas, numpy
4343
"hdrhistogram>=0.10.1",
44+
"ujson",
4445
]
4546
dynamic = ["version"]
4647

vectordb_bench/backend/clients/polardb/polardb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,14 @@ def init(self):
109109
db_name = self.db_config["database"]
110110
hint = "/*+ SET_VAR(imci_enable_fast_vector_search=on) */"
111111

112-
self.insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)" # noqa: S608
112+
self.insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)"
113113
self.select_sql = (
114-
f"SELECT {hint} id FROM {db_name}.{self.table_name} " # noqa: S608
114+
f"SELECT {hint} id FROM {db_name}.{self.table_name} "
115115
f"ORDER BY DISTANCE(v, _binary %s, '{metric_type}') "
116116
f"LIMIT %s"
117117
)
118118
self.select_sql_with_filter = (
119-
f"SELECT id FROM {db_name}.{self.table_name} " # noqa: S608
119+
f"SELECT id FROM {db_name}.{self.table_name} "
120120
f"WHERE id >= %s "
121121
f"ORDER BY DISTANCE(v, _binary %s, '{metric_type}') "
122122
f"LIMIT %s"
@@ -218,7 +218,7 @@ def _insert_batch(self, embeddings: list[list[float]], metadata: list[int], offs
218218
conn, cursor = self._create_connection()
219219
try:
220220
db_name = self.db_config["database"]
221-
insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)" # noqa: S608
221+
insert_sql = f"INSERT INTO {db_name}.{self.table_name} (id, v) VALUES (%s, _binary %s)"
222222
batch_data = []
223223
for i in range(offset, offset + size):
224224
batch_data.append((int(metadata[i]), self.vector_to_hex(embeddings[i])))

0 commit comments

Comments
 (0)