Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update array node model #3156

Merged
merged 4 commits into from
Feb 27, 2025
Merged

update array node model #3156

merged 4 commits into from
Feb 27, 2025

Conversation

pvditt
Copy link
Contributor

@pvditt pvditt commented Feb 25, 2025

Tracking issue

ref: https://linear.app/unionai/issue/COR-2662/update-sdk-to-support-bound-inputs-for-mapping-over-launch-plans

Why are the changes needed?

Checking this in for future support for array_node_map_task to fix flyteorg/flyte#4325

Need to put this here for union.map to bind inputs for when mapping over launch plans

What changes were proposed in this pull request?

Set bound input field in array node spec

How was this patch tested?

Ran in sandbox w/ union sdk changes

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

Implementation of bound inputs support in array node mapping, specifically for mapping over launch plans. The changes encompass adding bound_inputs property to ArrayNode class, updating workflow model for bound inputs handling, and modifying the translator. The PR also includes an update to flyteidl dependency to version 1.15.1.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 1

Signed-off-by: Paul Dittamo <[email protected]>
@flyte-bot
Copy link
Contributor

Code Review Agent Run Status

  • Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

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

Project coverage is 35.80%. Comparing base (5a17d74) to head (230f433).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
flytekit/models/core/workflow.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3156       +/-   ##
===========================================
- Coverage   76.59%   35.80%   -40.79%     
===========================================
  Files         211      212        +1     
  Lines       22008    22028       +20     
  Branches     2865     2865               
===========================================
- Hits        16856     7888     -8968     
- Misses       4361    14027     +9666     
+ Partials      791      113      -678     

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

Signed-off-by: Paul Dittamo <[email protected]>
@flyte-bot
Copy link
Contributor

Code Review Agent Run Status

  • Limitations and other issues: ❌ Failure - The AI Code Review Agent skipped reviewing this change because it is configured to exclude certain pull requests based on the source/target branch or the pull request status. You can change the settings here, or contact the agent instance creator at [email protected].

@pvditt pvditt enabled auto-merge (squash) February 27, 2025 19:11
@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 27, 2025

Code Review Agent Run #73d43e

Actionable Suggestions - 2
  • flytekit/models/core/workflow.py - 1
    • Consider adding type hints for bound_inputs · Line 398-398
  • flytekit/core/array_node.py - 1
    • Consider returning instance variable for bound_inputs · Line 232-233
Review Details
  • Files reviewed - 4 · Commit Range: 230f433..039da41
    • flytekit/core/array_node.py
    • flytekit/models/core/workflow.py
    • flytekit/tools/translator.py
    • pyproject.toml
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

@flyte-bot
Copy link
Contributor

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Array Node Model Enhancement for Launch Plan Support

array_node.py - Added bound_inputs property to ArrayNode class

workflow.py - Added bound_inputs field to workflow model

translator.py - Updated translator to handle array node bound inputs

Other Improvements - Dependency Version Update

pyproject.toml - Updated flyteidl dependency from 1.15.0 to 1.15.1

@@ -395,6 +395,7 @@ def __init__(
execution_mode=None,
is_original_sub_node_interface=False,
data_mode=None,
bound_inputs=None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding type hints for bound_inputs

Consider adding type hints for the bound_inputs parameter in the constructor. This would help with code maintainability and IDE support.

Code suggestion
Check the AI-generated fix before applying
 -        node: "Node",
 -        bound_inputs=None,
 +        node: "Node",
 +        bound_inputs: typing.Optional[typing.List[_Binding]] = None,

Code Review Run #73d43e


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Comment on lines +232 to +233
def bound_inputs(self) -> Set[str]:
return set()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider returning instance variable for bound_inputs

The bound_inputs property appears to be returning an empty set while there is an instance variable self._bound_inputs that seems to be the intended return value. Consider returning self._bound_inputs instead of an empty set.

Code suggestion
Check the AI-generated fix before applying
Suggested change
def bound_inputs(self) -> Set[str]:
return set()
def bound_inputs(self) -> Set[str]:
return self._bound_inputs

Code Review Run #73d43e


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@pvditt pvditt merged commit a117bcd into master Feb 27, 2025
112 checks passed
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.

[Core feature] list support for partials (map_task)
3 participants