Skip to content

fix(dashboard): accept async_mode in json_metadata schema - #43895

Merged
villebro merged 1 commit into
apache:gaq-to-gtffrom
villebro:fix-dashboard-async-mode-metadata
Sep 4, 2026
Merged

villebro merged 1 commit into
apache:gaq-to-gtffrom
villebro:fix-dashboard-async-mode-metadata

Conversation

@villebro

@villebro villebro commented Sep 4, 2026

Copy link
Copy Markdown
Member

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, but DashboardJSONMetadataSchema did not declare the field. validate_json_metadata calls DashboardJSONMetadataSchema().validate(..., partial=False), which rejects unknown fields, so the dashboard PUT failed with 422 "Unknown field" and the override never persisted.

This declares async_mode as an optional string validated to default / force_on / force_off (the values the frontend resolveAsyncMode chain emits; the modal deletes the key for default). No backend execution change — chart-data async is driven by a request-level async_mode flag 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 (integration dashboards/api_tests.py): the PUT payload now includes async_mode: "force_off" and asserts it round-trips. Schema accept/reject was also verified directly (force_on/force_off/default valid; unknown value rejected).

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags: GLOBAL_ASYNC_QUERIES (the override only surfaces in the UI when async is available)
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

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.

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-code-review

bito-code-review Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped - Branch Excluded

Bito didn't auto-review because the source or target branch is excluded from automatic reviews.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change the branch exclusion settings here, or contact your Bito workspace admin at [email protected].

@netlify

netlify Bot commented Sep 4, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit f71c093
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a9b2484b2be240008d58590
😎 Deploy Preview https://deploy-preview-43895--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.65%. Comparing base (994fe67) to head (f71c093).

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           
Flag Coverage Δ
hive 37.76% <100.00%> (+<0.01%) ⬆️
mysql 57.41% <100.00%> (+<0.01%) ⬆️
postgres 57.44% <100.00%> (+<0.01%) ⬆️
presto 39.65% <100.00%> (+<0.01%) ⬆️
python 84.06% <100.00%> (+<0.01%) ⬆️
sqlite 57.13% <100.00%> (+<0.01%) ⬆️
unit 74.79% <100.00%> (+<0.01%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@villebro

villebro commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

/review

@bito-code-review

bito-code-review Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #825c0b

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: f71c093..f71c093
    • superset/dashboards/schemas.py
    • tests/integration_tests/dashboards/api_tests.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@villebro
villebro merged commit 3915c9b into apache:gaq-to-gtf Sep 4, 2026
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant