<#3274 [BUG] sync_node_executions fails for workfl...
# flyte-github
c
#3274 [BUG] sync_node_executions fails for workflows with BranchNode Pull request opened by machichima ## Tracking issue Part of flyteorg/flyte#6490 ## Why are the changes needed? When using flytekit's
FlyteRemote
and calling
remote.wait
on an execution of a workflow that contains a
BranchNode
, we will get following error:
Copy code
execution = remote.wait(execution=execution, timeout=timeout)
../../../../../anaconda3/envs/flyte/lib/python3.10/site-packages/flytekit/remote/remote.py:2384: in wait
    execution = self.sync_execution(execution, sync_nodes=sync_nodes)
../../../../../anaconda3/envs/flyte/lib/python3.10/site-packages/flytekit/remote/remote.py:2479: in sync_execution
    node_execs[n.id.node_id] = self.sync_node_execution(n, node_mapping)  
E           AttributeError: 'FlyteBranchNode' object has no attribute 'interface'

../../../../../anaconda3/envs/flyte/lib/python3.10/site-packages/flytekit/remote/remote.py:2648: AttributeError
## What changes were proposed in this pull request? In some cases, the
execution.metadata.is_parent_node
for branch node is not True, which lead to the block without managing branch node separately. Moving the logic handling branch node before checking
is_parent_node
to handle both is and is not branch node cases ## How was this patch tested? integration test ### Setup process ### Screenshots ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs ## Docs link https://bito.ai#summarystart| ### Summary by Bito This pull request enhances the handling of branch nodes in Flytekit's execution logic, fixing a bug related to their management and ensuring they are handled correctly regardless of their parent node status. It introduces a new conditional workflow and tests to improve the library's robustness for complex workflows by preventing errors associated with missing attributes in branch nodes. flyteorg/flytekit