-
Notifications
You must be signed in to change notification settings - Fork 310
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
Enable using positional args for workflow with default value #3149
Enable using positional args for workflow with default value #3149
Conversation
so that in flyte_entity_call_handler the kwargs will not contain args Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Code Review Agent Run #a46a9eActionable Suggestions - 1
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks pretty good, just a couple of nits.
@workflow | ||
def wf_mixed_positional_and_keyword_args() -> int: | ||
return sub_wf(arg1, y=arg2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also add a case where we invoke sub_wf
with a mix of positional args and default values? For example:
@workflow
def wf_mixed_positional_and_default_args() -> int:
return sub_wf(arg1)
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just use debugger to check the whole process, thank you @machichima
Code Review Agent Run #abe196Actionable Suggestions - 2
Review Details
|
This looks great, thank you! |
Tracking issue
flyteorg/flyte#6208
Why are the changes needed?
Remove the value in
input_kwargs
(which contains the default value) if the value is set inargs
, to prevent passingkwargs
andargs
both for same argument, which cause the error described in the issue.What changes were proposed in this pull request?
How was this patch tested?
Add test
test_positional_args_workflow_with_default_value
extend fromtest_positional_args_task
for positional arguments with default value setSetup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This PR addresses subworkflow argument handling by preventing simultaneous use of positional arguments and default values. The workflow execution logic has been modified to properly handle input_kwargs when positional arguments are provided. Test coverage has been enhanced to validate subworkflow behavior, including test cases for mixed positional and default arguments scenarios, extra arguments handling, and keyword arguments validation.Unit tests added: True
Estimated effort to review (1-5, lower is better): 2