Fix linting

This commit is contained in:
yangdx
2025-04-02 16:36:28 +08:00
parent 3ed7f11b4c
commit c2f007199f

View File

@@ -173,7 +173,9 @@ class Neo4JStorage(BaseGraphStorage):
"CREATE INDEX FOR (n:base) ON (n.entity_id)" "CREATE INDEX FOR (n:base) ON (n.entity_id)"
) )
await result.consume() await result.consume()
logger.info(f"Created index for base nodes on entity_id in {database}") logger.info(
f"Created index for base nodes on entity_id in {database}"
)
except Exception: except Exception:
# Fallback if db.indexes() is not supported in this Neo4j version # Fallback if db.indexes() is not supported in this Neo4j version
result = await session.run( result = await session.run(
@@ -778,13 +780,13 @@ class Neo4JStorage(BaseGraphStorage):
logger.warning( logger.warning(
"Neo4j: falling back to basic Cypher recursive search..." "Neo4j: falling back to basic Cypher recursive search..."
) )
return await self._robust_fallback( return await self._robust_fallback(node_label, max_depth, max_nodes)
node_label, max_depth, max_nodes
)
return result return result
async def _robust_fallback(self, node_label: str, max_depth: int, max_nodes: int) -> KnowledgeGraph: async def _robust_fallback(
self, node_label: str, max_depth: int, max_nodes: int
) -> KnowledgeGraph:
""" """
Fallback implementation when APOC plugin is not available or incompatible. Fallback implementation when APOC plugin is not available or incompatible.
This method implements the same functionality as get_knowledge_graph but uses This method implements the same functionality as get_knowledge_graph but uses