-
Notifications
You must be signed in to change notification settings - Fork 0
Improved errors #33
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
Open
andreasjansson
wants to merge
10
commits into
main
Choose a base branch
from
improved-errors
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improved errors #33
Conversation
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
… exit with code 1
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
Adds a prediction_index
to task runs and predictions so that logs and error messages are prefixed with an index for easier tracing.
- Introduce
prediction_index
onTask
subclasses and propagate it intopredict
calls. - Prefix verbose logs and raised errors with the index when supplied.
- Update
main.py
to assign and incrementprediction_index
for each task and adjust error handling to report indices.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
cog_safe_push/tasks.py | Added prediction_index field; prefixed log.v and raise calls with index |
cog_safe_push/predict.py | Extended predict signature to accept prediction_index and prefix logs |
cog_safe_push/main.py | Initialized/incremented prediction_index for tasks and updated error aggregation to include indices |
Comments suppressed due to low confidence (2)
cog_safe_push/tasks.py:177
- This
if error is not None
block is redundant and unreachable because any non-Noneerror
would have triggered an earlier check; consider removing this duplicate error check.
if error is not None:
cog_safe_push/predict.py:236
- [nitpick] There are no tests verifying that
prediction_index
is correctly propagated and prefixed in logs; consider adding unit tests to assert the behavior whenprediction_index
is set and unset.
prefix = f"[{prediction_index}] " if prediction_index is not None else ""
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
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.
Important
Add
prediction_index
to improve error logging and tracking in prediction tasks across multiple modules.prediction_index
tocog_safe_push()
inmain.py
to track prediction tasks.run_tasks()
inmain.py
to log errors withprediction_index
.predict()
inpredict.py
to includeprediction_index
in logs.prediction_index
attribute toCheckOutputsMatch
,RunTestCase
, andFuzzModel
intasks.py
.prediction_index
inrun()
methods of these classes for better error tracking.main.py
,predict.py
, andtasks.py
to includeprediction_index
for improved error context.This description was created by
for fa8a261. You can customize this summary. It will automatically update as commits are pushed.