fix(chart): add error logging to /api/v1/chart/data endpoint#38744
Draft
rebenitez1802 wants to merge 1 commit intomasterfrom
Draft
fix(chart): add error logging to /api/v1/chart/data endpoint#38744rebenitez1802 wants to merge 1 commit intomasterfrom
rebenitez1802 wants to merge 1 commit intomasterfrom
Conversation
Add error-level logging to all failure paths in the chart data API to help diagnose intermittent 400 BAD REQUEST failures during CSV exports. Previously, JSON parsing errors were silently swallowed by contextlib.suppress and validation/query errors returned 400 without any logging, making it impossible to identify which failure path was hit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c21321d to
d15f781
Compare
EnxDev
reviewed
Mar 23, 2026
| request.content_length, | ||
| bool(request.form.get("form_data")), | ||
| request.referrer, | ||
| ) |
Contributor
There was a problem hiding this comment.
When form_data is present but unparseable, this block fires after the except above has already logged. A single parse failure produces two logger.error entries in the log, which could be confusing when correlating events.
Contributor
|
Yes, the code change introduces duplicate logging for unparseable form_data. The except block logs an error on JSONDecodeError, and then the subsequent if json_body is None block logs another error, leading to two entries for a single failure. superset/charts/data/api.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Add error-level logging to all failure paths in the chart data API (
/api/v1/chart/data) to help diagnose intermittent 400 BAD REQUEST failures during CSV exports.TESTING INSTRUCTIONS
ADDITIONAL INFORMATION