Repository navigation
fix(dashboard): accept async_mode in json_metadata schema - #43895
Conversation
The Properties modal writes the per-dashboard async override into json_metadata.async_mode, but DashboardJSONMetadataSchema did not declare it, so DashboardJSONMetadataSchema().validate() rejected it and the dashboard PUT failed with 422 "Unknown field" — the override could never be saved. Declare async_mode as an optional string validated to default/force_on/force_off (the values the frontend resolver emits). Backend chart-data execution is unaffected: it reads a request-level async_mode flag, not this metadata key, which is frontend-consumed. Fold the persistence assertion into the existing test_update_dashboard_persists_metadata_fields_without_dedicated_handling.
|
Bito Automatic Review Skipped - Branch Excluded |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## gaq-to-gtf #43895 +/- ##
===========================================
Coverage 79.65% 79.65%
===========================================
Files 2908 2908
Lines 169508 169509 +1
Branches 39273 39273
===========================================
+ Hits 135024 135025 +1
Misses 31962 31962
Partials 2522 2522
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/review |
Code Review Agent Run #825c0bActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Addresses the blocking finding in the umbrella review (#43407 review): the per-dashboard async override could not be saved.
The Properties modal writes the override into
json_metadata.async_mode, butDashboardJSONMetadataSchemadid not declare the field.validate_json_metadatacallsDashboardJSONMetadataSchema().validate(..., partial=False), which rejects unknown fields, so the dashboardPUTfailed with422 "Unknown field"and the override never persisted.This declares
async_modeas an optional string validated todefault/force_on/force_off(the values the frontendresolveAsyncModechain emits; the modal deletes the key fordefault). No backend execution change — chart-data async is driven by a request-levelasync_modeflag on/chart/data, not this metadata key, which is frontend-consumed.TESTING INSTRUCTIONS
Folded the persistence assertion into the existing
test_update_dashboard_persists_metadata_fields_without_dedicated_handling(integrationdashboards/api_tests.py): the PUT payload now includesasync_mode: "force_off"and asserts it round-trips. Schema accept/reject was also verified directly (force_on/force_off/defaultvalid; unknown value rejected).ADDITIONAL INFORMATION
GLOBAL_ASYNC_QUERIES(the override only surfaces in the UI when async is available)Note on the review's second (non-blocking) point — the possibly-leaked GTF abort listener flaking the oauth2 test's caplog: I could not reproduce or localize it. The tasks tests that start a real abort listener (
test_handlers,test_timeout) already stop it in fixture teardown, and the others (test_manager,test_query_cancel) mock the listener, so there's no obvious unstopped listener in the current code. Suggest handling as a separate follow-up once we have the failing CI seed to reproduce deterministically, rather than adding a speculative teardown here.