🐛 fix(base.py): fix validation logic in _validate_nodes method to handle case when there is only one node in the graph
This commit is contained in:
parent
a0748e1093
commit
9811b97908
1 changed files with 2 additions and 2 deletions
|
|
@ -133,8 +133,8 @@ class CustomComponent(Component):
|
|||
def load_flow(self, flow_id: UUID = None):
|
||||
from langflow.processing.process import build_sorted_vertices_with_caching
|
||||
|
||||
with get_session() as session:
|
||||
data_graph = flow.data if (flow := session.get(Flow, flow_id)) else None
|
||||
session = next(get_session())
|
||||
data_graph = flow.data if (flow := session.get(Flow, flow_id)) else None
|
||||
if not data_graph:
|
||||
raise ValueError(f"Flow {flow_id} not found")
|
||||
return build_sorted_vertices_with_caching(data_graph)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue