-
Notifications
You must be signed in to change notification settings - Fork 305
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
fix: add FlyteValueException handling and clean up exit_handler calls #3036
base: master
Are you sure you want to change the base?
Changes from 1 commit
ea17a4d
60f4732
f1d19c8
722b2da
c6d70d7
0cc4aec
912cf34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -168,7 +168,7 @@ def execute(self, *args, **kwargs): | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
write_example_notebook(task_function=self.task_function, notebook_dir=self.notebook_dir) | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
return exit_handler( | ||||||||||||||||||||||||||||
exit_handler( | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We cannot remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @pingsutw flytekit/flytekit/core/base_task.py Lines 779 to 783 in ea17a4d
the following tests will fail as they would return the mock handler but the output interface expects to have 0 outputs
flytekit/tests/flytekit/unit/interactive/test_flyteinteractive_vscode.py Lines 139 to 142 in 9c2caa1
this one should fail, too flytekit/plugins/flytekit-flyteinteractive/tests/test_flyteinteractive_jupyter.py Lines 38 to 41 in 9c2caa1
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, you can add return type to that function.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding mock.patch(
"flytekit.interactive.vscode_lib.decorator.exit_handler",
return_value="Hello, world!", However, this will further lead to other errors, which I don't think is solvable as @VScode may not always return exit_handler(). Thanks. full error logvscode_patches = (, , <MagicMock...10240'>, , , ...)
tests/flytekit/unit/interactive/test_flyteinteractive_vscode.py:149: flytekit/core/workflow.py:308: in call cls = <class 'flytekit.core.type_engine.TypeEngine'>, python_val = None, python_type = <class 'str'>
E flytekit.core.type_engine.TypeTransformerFailedError: Failed to convert outputs of task 'channelexec.test_flyteinteractive_vscode.t' at position 0. flytekit/core/type_engine.py:1330: TypeTransformerFailedError There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just mock the return value to None in the unit test? ( |
||||||||||||||||||||||||||||
child_process=child_process, | ||||||||||||||||||||||||||||
task_function=self.task_function, | ||||||||||||||||||||||||||||
args=args, | ||||||||||||||||||||||||||||
|
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.
The
exit_handler
function returns a value but the return value is not being captured. Consider capturing the return value or handling it appropriately. A similar issue was also found in plugins/flytekit-flyteinteractive/flytekitplugins/flyteinteractive/jupyter_lib/decorator.py (line 171).Code suggestion
Code Review Run #a5368c
Is this a valid issue, or was it incorrectly flagged by the Agent?