Revert "Cleanup of code"

This commit is contained in:
Yannick Stephan
2025-02-20 15:09:43 +01:00
committed by GitHub
parent c431cd584a
commit 678e0f9aea
12 changed files with 84 additions and 7 deletions

View File

@@ -178,10 +178,12 @@ class PostgreSQLDB:
asyncpg.exceptions.UniqueViolationError,
asyncpg.exceptions.DuplicateTableError,
) as e:
if not upsert:
logger.error(f"PostgreSQL, upsert error: {e}")
if upsert:
print("Key value duplicate, but upsert succeeded.")
else:
logger.error(f"Upsert error: {e}")
except Exception as e:
logger.error(f"PostgreSQL database, sql:{sql}, data:{data}, error:{e}")
logger.error(f"PostgreSQL database,\nsql:{sql},\ndata:{data},\nerror:{e}")
raise
@@ -1085,6 +1087,9 @@ class PGGraphStorage(BaseGraphStorage):
) -> tuple[np.ndarray[Any, Any], list[str]]:
raise NotImplementedError
async def get_all_labels(self) -> list[str]:
raise NotImplementedError
async def get_knowledge_graph(
self, node_label: str, max_depth: int = 5
) -> KnowledgeGraph: