Skip to content
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: JSON loading logs #30138

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

michael-s-molina
Copy link
Member

SUMMARY

#28702 unified JSON calls to a single module which is great. Unfortunately, that PR also altered the default behavior when loading a JSON object and added a log entry every time an invalid object is parsed to the utility function. It is the responsibility of the caller to decide how to deal with an invalid JSON. In many places, a default empty object is used when an invalid JSON is received and there's no need for extra logs. This PR restores the previous behavior.

Fixes #30079

TESTING INSTRUCTIONS

Check the original issue for instructions.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the logging Creates a UI or API endpoint that could benefit from logging. label Sep 3, 2024
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.65%. Comparing base (76d897e) to head (b7a55f2).
Report is 658 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #30138       +/-   ##
===========================================
+ Coverage   60.48%   83.65%   +23.16%     
===========================================
  Files        1931      529     -1402     
  Lines       76236    38268    -37968     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    32013    -14101     
+ Misses      28017     6255    -21762     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.90% <16.66%> (-0.26%) ⬇️
javascript ?
mysql 76.73% <100.00%> (?)
postgres 76.81% <100.00%> (?)
presto 53.48% <16.66%> (-0.32%) ⬇️
python 83.65% <100.00%> (+20.16%) ⬆️
sqlite 76.27% <100.00%> (?)
unit 60.25% <100.00%> (+2.63%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sadpandajoe sadpandajoe added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Sep 3, 2024
Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - my bad for letting that previous one slip allow for a change in behavior. I'm really glad we've centralize all that json-related logic here though!

@michael-s-molina michael-s-molina merged commit 5c5b4d0 into apache:master Sep 3, 2024
40 of 41 checks passed
sadpandajoe pushed a commit that referenced this pull request Sep 3, 2024
(cherry picked from commit 5c5b4d0)
@eyalezer
Copy link
Contributor

@michael-s-molina - good catch, thanks
@mistercrunch - indeed , at least now we got it all in one place ☺️

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logging Creates a UI or API endpoint that could benefit from logging. size/S v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking on a chart causes an error in logs: ERROR:superset.utils.json:JSON is not valid (4.1.0rc2)
4 participants