-
Notifications
You must be signed in to change notification settings - Fork 63
fix: raise GokartBuildError on FAILED_AND_SCHEDULING_FAILED status #465
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
Conversation
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.
Pull Request Overview
This pull request enhances error handling in gokart by extending the set of statuses that trigger exceptions during task builds.
- Added new status checks (FAILED_AND_SCHEDULING_FAILED and SCHEDULING_FAILED) in the build function.
- Introduced a unit test to verify that a GokartBuildError is raised in the new error scenario.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
test/test_build.py | Added a unit test to validate error raising when the build result indicates failure due to scheduling issues. |
gokart/build.py | Updated the status check in _build_task to include additional failure statuses. |
Comments suppressed due to low confidence (1)
test/test_build.py:212
- Consider adding an additional unit test case for when result.status is LuigiStatusCode.SCHEDULING_FAILED to ensure that both newly handled statuses are adequately covered.
with patch('luigi.build') as mock_luigi_build:
@@ -204,7 +204,7 @@ def _build_task(): | |||
) | |||
if task_lock_exception_raised.flag: | |||
raise HasLockedTaskException() |
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.
[nitpick] Consider documenting the rationale for grouping the FAILED, FAILED_AND_SCHEDULING_FAILED, and SCHEDULING_FAILED statuses together. This makes the intention clearer, especially if their handling may diverge in the future.
raise HasLockedTaskException() | |
raise HasLockedTaskException() | |
# Grouping statuses that represent failure scenarios. These statuses indicate that the task either failed during execution, | |
# failed during scheduling, or both. They are treated similarly to trigger the same error handling logic. |
Copilot uses AI. Check for mistakes.
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!
LGTM |
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
@@ -204,7 +204,7 @@ def _build_task(): | |||
) | |||
if task_lock_exception_raised.flag: | |||
raise HasLockedTaskException() | |||
if result.status == luigi.LuigiStatusCode.FAILED: | |||
if result.status in (LuigiStatusCode.FAILED, LuigiStatusCode.FAILED_AND_SCHEDULING_FAILED, LuigiStatusCode.SCHEDULING_FAILED): |
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.
42bbcb6
to
8c73d58
Compare
This pull request enhances error handling in
gokart
by extending the set of statuses that trigger exceptions during task builds and adding corresponding unit tests. The changes ensure more robust handling of scheduling failures and improve test coverage.