style: ruff-format
This commit is contained in:
parent
b860ffe510
commit
24cb11f3f5
2 changed files with 5 additions and 10 deletions
|
|
@ -164,9 +164,7 @@ class ChromaVectorDBStorage(BaseVectorStorage):
|
||||||
logger.error(f"Error during ChromaDB upsert: {str(e)}")
|
logger.error(f"Error during ChromaDB upsert: {str(e)}")
|
||||||
raise
|
raise
|
||||||
|
|
||||||
async def query(
|
async def query(self, query: str, top_k: int) -> list[dict[str, Any]]:
|
||||||
self, query: str, top_k: int
|
|
||||||
) -> list[dict[str, Any]]:
|
|
||||||
try:
|
try:
|
||||||
embedding = await self.embedding_func(
|
embedding = await self.embedding_func(
|
||||||
[query], _priority=5
|
[query], _priority=5
|
||||||
|
|
|
||||||
|
|
@ -788,9 +788,9 @@ class PostgreSQLDB:
|
||||||
WHERE table_name = $1 AND column_name = $2
|
WHERE table_name = $1 AND column_name = $2
|
||||||
"""
|
"""
|
||||||
params = {
|
params = {
|
||||||
"table_name": migration["table"].lower(),
|
"table_name": migration["table"].lower(),
|
||||||
"column_name": migration["column"],
|
"column_name": migration["column"],
|
||||||
}
|
}
|
||||||
column_info = await self.query(
|
column_info = await self.query(
|
||||||
check_column_sql,
|
check_column_sql,
|
||||||
list(params.values()),
|
list(params.values()),
|
||||||
|
|
@ -1036,9 +1036,7 @@ class PostgreSQLDB:
|
||||||
AND table_schema = 'public'
|
AND table_schema = 'public'
|
||||||
"""
|
"""
|
||||||
params = {"table_name": table_name.lower()}
|
params = {"table_name": table_name.lower()}
|
||||||
table_exists = await self.query(
|
table_exists = await self.query(check_table_sql, list(params.values()))
|
||||||
check_table_sql, list(params.values())
|
|
||||||
)
|
|
||||||
|
|
||||||
if not table_exists:
|
if not table_exists:
|
||||||
logger.info(f"Creating table {table_name}")
|
logger.info(f"Creating table {table_name}")
|
||||||
|
|
@ -3175,7 +3173,6 @@ class PGGraphStorage(BaseGraphStorage):
|
||||||
return result[node_id]
|
return result[node_id]
|
||||||
|
|
||||||
async def edge_degree(self, src_id: str, tgt_id: str) -> int:
|
async def edge_degree(self, src_id: str, tgt_id: str) -> int:
|
||||||
|
|
||||||
result = await self.edge_degrees_batch(edges=[(src_id, tgt_id)])
|
result = await self.edge_degrees_batch(edges=[(src_id, tgt_id)])
|
||||||
if result and (src_id, tgt_id) in result:
|
if result and (src_id, tgt_id) in result:
|
||||||
return result[(src_id, tgt_id)]
|
return result[(src_id, tgt_id)]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue