Skip to content

Conversation

machichima
Copy link
Member

@machichima machichima commented Jun 12, 2025

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:

   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

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.

Copy link

codecov bot commented Jun 12, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 76.44%. Comparing base (3c6b61d) to head (000b84d).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
flytekit/remote/remote.py 0.00% 5 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (3c6b61d) and HEAD (000b84d). Click for more details.

HEAD has 32 uploads less than BASE
Flag BASE (3c6b61d) HEAD (000b84d)
41 9
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3274      +/-   ##
==========================================
- Coverage   83.35%   76.44%   -6.92%     
==========================================
  Files         347      245     -102     
  Lines       28791    23657    -5134     
  Branches     2960     2961       +1     
==========================================
- Hits        23999    18084    -5915     
- Misses       3956     4711     +755     
- Partials      836      862      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@machichima machichima changed the title 6490 sync node exec branch [BUG] sync_node_executions fails for workflows with BranchNode Jun 12, 2025
-e
Signed-off-by: machichima <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant