-
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
prevent compile err for ReferenceWorkflow #3102
prevent compile err for ReferenceWorkflow #3102
Conversation
Signed-off-by: machichima <nary12321@gmail.com>
Code Review Agent Run #60519cActionable Suggestions - 0Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3102 +/- ##
===========================================
+ Coverage 51.81% 78.59% +26.77%
===========================================
Files 202 220 +18
Lines 21469 22235 +766
Branches 2766 2768 +2
===========================================
+ Hits 11125 17475 +6350
+ Misses 9735 3951 -5784
- Partials 609 809 +200 ☔ View full report in Codecov by Sentry. |
Signed-off-by: machichima <nary12321@gmail.com>
Code Review Agent Run #faa8faActionable Suggestions - 1
Review Details
|
remote_entity = remote.register_script( | ||
my_wf, | ||
project=PROJECT, | ||
domain=DOMAIN, | ||
image_config=ImageConfig.auto(img_name=IMAGE), | ||
destination_dir=DEST_DIR, | ||
source_path=MODULE_PATH, | ||
) |
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.
Consider moving the register_script
call before the reference_workflow
decorator since the registration should happen before referencing the workflow.
Code suggestion
Check the AI-generated fix before applying
def test_execute_reference_workflow(register):
+ remote = FlyteRemote(Config.auto(config_file=CONFIG), PROJECT, DOMAIN)
+ remote_entity = remote.register_script(
+ my_wf,
+ project=PROJECT,
+ domain=DOMAIN,
+ image_config=ImageConfig.auto(img_name=IMAGE),
+ destination_dir=DEST_DIR,
+ source_path=MODULE_PATH,
+ )
@reference_workflow(
project=PROJECT,
domain=DOMAIN,
name="basic.basic_workflow.my_wf",
version=VERSION,
)
def my_wf(a: int, b: str) -> (int, str):
return a + 2, b + "world"
-
- remote = FlyteRemote(Config.auto(config_file=CONFIG), PROJECT, DOMAIN)
- remote_entity = remote.register_script(
- my_wf,
- project=PROJECT,
- domain=DOMAIN,
- image_config=ImageConfig.auto(img_name=IMAGE),
- destination_dir=DEST_DIR,
- source_path=MODULE_PATH,
- )
Code Review Run #faa8fa
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
@@ -1275,6 +1275,8 @@ def register_script( | |||
:param fast_package_options: Options to customize copy_all behavior, ignored when copy_all is False. | |||
:return: | |||
""" | |||
if isinstance(entity, ReferenceWorkflow): |
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.
could we add all reference entities too? including launch plan and task? there's a base class for it.
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.
Sure! Let me have a look and open a new PR for it
* fix: prevent compile err for ReferenceWorkflow Signed-off-by: machichima <nary12321@gmail.com> * test: ref workflow integration test with register script Signed-off-by: machichima <nary12321@gmail.com> --------- Signed-off-by: machichima <nary12321@gmail.com> Signed-off-by: Umer Ahmad <umer2ahmad@gmail.com>
Tracking issue
Related to flyteorg/flyte#6097
Why are the changes needed?
Return the entity itself without trying to compile if the entity is Reference workflow
What changes were proposed in this pull request?
How was this patch tested?
Integration test
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
Fixed compilation error in remote.py by adding condition checks for ReferenceWorkflow entities. Enhanced the remote workflow testing framework with reference workflow testing capabilities, including new module imports and test cases. These changes ensure proper handling of reference workflow entities without compilation.Unit tests added: True
Estimated effort to review (1-5, lower is better): 1