fix(oocana): add warnings.warn for deprecated APIs#464
fix(oocana): add warnings.warn for deprecated APIs#464leavesster wants to merge 1 commit intomainfrom
Conversation
Use warnings.warn with DeprecationWarning for deprecated methods: - pkg_dir property: deprecated in favor of pkg_data_dir - send_error method: deprecated in favor of error() This allows users to catch deprecation warnings and migrate their code.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds runtime deprecation warnings using Python's warnings.warn() for two deprecated APIs in the Context class that previously only had docstring notices. This ensures users are actively notified when using deprecated functionality.
Changes:
- Added
warningsmodule import - Added
warnings.warn()calls withDeprecationWarningforpkg_dirproperty andsend_error()method - Updated docstrings to use proper Sphinx deprecation directive format
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
warnings.warn()withDeprecationWarningfor deprecated APIspkg_dirproperty,send_error()methodProblem
Deprecated APIs had docstring comments but no runtime warnings:
Users wouldn't know they're using deprecated APIs until reading docs.
Solution
Add proper deprecation warnings:
Test Plan