Improved errors#33
Open
andreasjansson wants to merge 10 commits into
Open
Conversation
… exit with code 1
There was a problem hiding this comment.
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_indexonTasksubclasses and propagate it intopredictcalls. - Prefix verbose logs and raised errors with the index when supplied.
- Update
main.pyto assign and incrementprediction_indexfor 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 Noneblock is redundant and unreachable because any non-Noneerrorwould 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_indexis correctly propagated and prefixed in logs; consider adding unit tests to assert the behavior whenprediction_indexis 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 <175728472+Copilot@users.noreply.github.com>
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.
Important
Add
prediction_indexto improve error logging and tracking in prediction tasks across multiple modules.prediction_indextocog_safe_push()inmain.pyto track prediction tasks.run_tasks()inmain.pyto log errors withprediction_index.predict()inpredict.pyto includeprediction_indexin logs.prediction_indexattribute toCheckOutputsMatch,RunTestCase, andFuzzModelintasks.py.prediction_indexinrun()methods of these classes for better error tracking.main.py,predict.py, andtasks.pyto includeprediction_indexfor improved error context.This description was created by
for fa8a261. You can customize this summary. It will automatically update as commits are pushed.