-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
refactor: Migration of json utilities from core #28522
Conversation
@mistercrunch - tests from last commit #28486 still covers for the encoding part. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #28522 +/- ##
===========================================
+ Coverage 60.48% 83.50% +23.01%
===========================================
Files 1931 522 -1409
Lines 76236 37485 -38751
Branches 8568 0 -8568
===========================================
- Hits 46114 31301 -14813
+ Misses 28017 6184 -21833
+ Partials 2105 0 -2105
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Starting to feel like we need a refactor of some kind here as this isn't DRY, maybe moving some things to a new I think I started this refactor before in a branch but never carried though. Let me push the branch for reference. Are you interested in taking this on? |
Here's the branch https://github.com/apache/superset/compare/refactor_json?expand=1, looks like I lost the json.py file along the way.... For now the goal would be to move the json-related function from utils/core to utils/json, and refactor the recent utf-16 handling in there. Eventually I'd like to also make sure all usage of |
definitely felt the same seeing things being repeated more than once while dealing with this non UTF-8 bytes. |
If you |
json_utils.dumps( | ||
payload, default=json_utils.json_iso_dttm_ser, ignore_nan=True | ||
), |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Stack trace information
Added missing implementation for utf-16
@mistercrunch - i've tried to keep it as small as possible for this first phase but it ended up with 30 files changed after all 😏 next phase (as mentioned) needs to be the refactoring of any |
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.
Did a quick pass and overall LGTM, looking to do another thorough pass on it, but seems safe overall
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.
Did another, more thorough pass and everything LGTM. Thanks for the refactor!
@mistercrunch - with pleasure. |
Co-authored-by: Eyal Ezer <[email protected]>
Co-authored-by: Eyal Ezer <[email protected]>
Co-authored-by: Eyal Ezer <[email protected]>
SUMMARY
initial step of refactoring JSON utilities