mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-21 00:22:45 +00:00
refactor(file_graph): remove unused iter_nodes abstract method
BREAKING CHANGE: Removed the iter_nodes abstract method from BaseFileGraph and its implementations in LocalFileGraph and Neo4jFileGraph as it was no longer being used in the codebase.
This commit is contained in:
parent
6a5561f86a
commit
d9114469e3
3 changed files with 0 additions and 17 deletions
|
|
@ -55,10 +55,6 @@ class BaseFileGraph(BaseComponent):
|
|||
async def get_node(self, path: str) -> FileNode | None:
|
||||
"""Single-node lookup."""
|
||||
|
||||
@abstractmethod
|
||||
def iter_nodes(self) -> AsyncIterator[tuple[str, FileNode]]:
|
||||
"""Walk every (path, FileNode) in the graph."""
|
||||
|
||||
# -- Link access -------------------------------------------------------
|
||||
|
||||
@abstractmethod
|
||||
|
|
|
|||
|
|
@ -121,12 +121,6 @@ class LocalFileGraph(BaseFileGraph):
|
|||
return None
|
||||
return self._graph.nodes[path].get("node")
|
||||
|
||||
async def iter_nodes(self) -> AsyncIterator[tuple[str, FileNode]]:
|
||||
for path, data in self._graph.nodes(data=True):
|
||||
node = data.get("node")
|
||||
if node is not None:
|
||||
yield path, node
|
||||
|
||||
# -- Link access -------------------------------------------------------
|
||||
|
||||
async def get_outlinks(self, path: str) -> list[tuple[FileNode, FileLink]]:
|
||||
|
|
|
|||
|
|
@ -208,13 +208,6 @@ class Neo4jFileGraph(BaseFileGraph):
|
|||
row = await rec.single()
|
||||
return self._row_to_node(row["f"]) if row else None
|
||||
|
||||
async def iter_nodes(self) -> AsyncIterator[tuple[str, FileNode]]:
|
||||
async with self._session() as session:
|
||||
rec = await session.run("MATCH (f:File) RETURN f")
|
||||
async for row in rec:
|
||||
node = self._row_to_node(row["f"])
|
||||
yield node.path, node
|
||||
|
||||
# -- Link access -------------------------------------------------------
|
||||
|
||||
async def get_outlinks(self, path: str) -> list[tuple[FileNode, FileLink]]:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue