-
Notifications
You must be signed in to change notification settings - Fork 310
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
Fix DeprecationWarning in pythonjsonlogger>=3.1.0
#3120
base: master
Are you sure you want to change the base?
Conversation
Thank you for opening this pull request! 🙌 These tips will help get your PR across the finish line:
|
Code Review Agent Run #bb460bActionable Suggestions - 0Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3120 +/- ##
==========================================
+ Coverage 79.60% 79.61% +0.01%
==========================================
Files 203 203
Lines 21625 21628 +3
Branches 2788 2789 +1
==========================================
+ Hits 17214 17220 +6
- Misses 3629 3631 +2
+ Partials 782 777 -5 ☔ View full report in Codecov by Sentry. |
I think the failing tests seem to be unrelated to my change? I'm not sure what's going on there. |
pythonjsonlogger.jsonlogger
is deprecated as of pythonjsonlogger>=3.1.0:https://github.com/nhairs/python-json-logger/releases/tag/v3.1.0
https://github.com/nhairs/python-json-logger/blob/db04a0f9066cc331f8d6177f828fe073c7b2a4cc/src/pythonjsonlogger/jsonlogger.py
Why are the changes needed?
This is a warning of an impending deprecation.
What changes were proposed in this pull request?
To not import a deprecated module.
How was this patch tested?
Running them in CI here. Let's find out if they pass.
Check all the applicable boxes
Summary by Bito
Updated import statement in flytekit/loggers.py to handle pythonjsonlogger>=3.1.0 deprecation warning. Implemented conditional import logic to check for new module path (pythonjsonlogger.json) with fallback to legacy path (pythonjsonlogger.jsonlogger). Change ensures backward compatibility across different versions of pythonjsonlogger package.Unit tests added: False
Estimated effort to review (1-5, lower is better): 1