chore: replace pending print statements with logger#266
Conversation
WalkthroughStartup and persistence messages were switched from ChangesLogging output updates
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lightspeed_evaluation/core/output/data_persistence.py (1)
71-72: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winLog the traceback on save failures.
logger.error(..., e)loses the stack trace, and this function immediately returnsNone, so the root cause is hard to recover later. Preferlogger.exception(...)(orexc_info=True) here.Suggested change
- except (OSError, yaml.YAMLError) as e: - logger.error("Failed to save amended evaluation data: %s", e) + except (OSError, yaml.YAMLError): + logger.exception("Failed to save amended evaluation data") return None🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lightspeed_evaluation/core/output/data_persistence.py` around lines 71 - 72, The save failure logging in the exception handler for the amended evaluation data should preserve the traceback instead of only formatting the exception object. Update the exception path in the data persistence flow to use logger.exception or logger.error with exc_info=True so the stack trace is emitted when the write/save operation fails, keeping the existing failure message and the surrounding try/except behavior intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/lightspeed_evaluation/core/output/data_persistence.py`:
- Around line 71-72: The save failure logging in the exception handler for the
amended evaluation data should preserve the traceback instead of only formatting
the exception object. Update the exception path in the data persistence flow to
use logger.exception or logger.error with exc_info=True so the stack trace is
emitted when the write/save operation fails, keeping the existing failure
message and the surrounding try/except behavior intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a4e39b1b-e7a0-4abe-89e7-cc7c80a6b028
📒 Files selected for processing (4)
src/lightspeed_evaluation/core/llm/deepeval.pysrc/lightspeed_evaluation/core/metrics/custom/custom.pysrc/lightspeed_evaluation/core/output/data_persistence.pytests/unit/core/llm/test_deepeval_manager.py
Description
(Release Readiness) chore: replace pending print statement with logger
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit