Fix: Improve error handling in workflow compilation when output binding fails#2047
Merged
Conversation
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2047 +/- ##
==========================================
- Coverage 85.98% 82.53% -3.46%
==========================================
Files 308 313 +5
Lines 22946 23602 +656
Branches 3468 3535 +67
==========================================
- Hits 19731 19479 -252
- Misses 2615 3498 +883
- Partials 600 625 +25 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
kumare3
reviewed
Jan 2, 2024
| ) | ||
| bindings.append(b) | ||
| except Exception as e: | ||
| raise AssertionError(f"Failed to bind output {output_names[0]} for function {self.name}: {e}") from e |
Contributor
There was a problem hiding this comment.
@wild-endeavor should these be AssertionErrors? or FlyteExceptions?
Member
Author
There was a problem hiding this comment.
I used AssertionError in analogy to how it is done here but I'm happy to change to FlyteException if you prefer.
Contributor
|
one comment else lgtm |
added 2 commits
January 30, 2024 23:00
Signed-off-by: Fabio Grätz <fabiogratz@googlemail.com>
Signed-off-by: Fabio Grätz <fabiogratz@googlemail.com>
pingsutw
approved these changes
Jan 31, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
When registering this workflow, one gets the following obvious error:
However, the exception does not hint which workflow/output is causing the error. In a large workflow with numerous sub workflows and dozens of tasks, it took one of our ML engineers quite some time to figure out where exactly the
returnwas missing. They asked whether we could make this simpler.What changes were proposed in this pull request?
I propose to catch errors raised by
binding_from_python_stdin thePythonFunctionWorkflow'scompilefunction just as is done e.g. here.This way, finding the error would have been a no-brainer.
How was this patch tested?
For the example workflow above, the error message now is:
Check all the applicable boxes