Skip to content

Commit

Permalink
fix: assign frozen flag from group to node correctly (#2867)
Browse files Browse the repository at this point in the history
* fix: remove unnecessary code related to vertex parent_node_id in Graph class

* fix: update node["frozen"] assignment to node["data"]["node"]["frozen"] in add_frozen function
  • Loading branch information
ogabrielluiz authored and anovazzi1 committed Jul 22, 2024
1 parent edecb38 commit 639619b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/backend/base/langflow/graph/graph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,8 +869,7 @@ async def build_vertex(
self.run_manager.add_to_vertices_being_run(vertex_id)
try:
params = ""
parent_vertex = self.get_vertex(vertex.parent_node_id) if vertex.parent_node_id else None
if vertex.frozen or (parent_vertex and parent_vertex.frozen):
if vertex.frozen:
# Check the cache for the vertex
cached_result = await chat_service.get_cache(key=vertex.id)
if isinstance(cached_result, CacheMiss):
Expand Down
2 changes: 1 addition & 1 deletion src/backend/base/langflow/graph/graph/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def add_frozen(nodes, frozen):
This function receives a list of nodes and adds a frozen to each node.
"""
for node in nodes:
node["frozen"] = frozen
node["data"]["node"]["frozen"] = frozen


def ungroup_node(group_node_data, base_flow):
Expand Down

0 comments on commit 639619b

Please sign in to comment.