flytekit
flytekit copied to clipboard
[BUG] sync_node_executions fails for workflows with BranchNode
Tracking issue
Part of https://github.com/flyteorg/flyte/issues/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:
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.
- [x] All new and existing tests passed.
- [x] All commits are signed-off.