Add SupersetService.import_dashboard for provisioning standard dashboards#1438
Open
roboton wants to merge 1 commit into
Open
Add SupersetService.import_dashboard for provisioning standard dashboards#1438roboton wants to merge 1 commit into
roboton wants to merge 1 commit into
Conversation
…ards Wraps Superset's POST /api/v1/dashboard/import/ using the service's existing token/CSRF/retry plumbing. First building block for auto-provisioning the dbt_taf_metrics standard dashboards (DalgoT4D/dalgo-dashboard-templates) per org. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesSuperset dashboard import
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant SupersetService
participant SupersetAuth
participant SupersetAPI
SupersetService->>SupersetAuth: Get access token and CSRF/session credentials
SupersetAuth-->>SupersetService: Return authentication values
SupersetService->>SupersetAPI: POST multipart dashboard bundle and import options
SupersetAPI-->>SupersetService: Return JSON response
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Why
Part of the standardized-metrics work (design doc): orgs that enable the
dbt_taf_metricspackage should get the canned Survey Operations / Chat Engagement dashboards (DalgoT4D/dalgo-dashboard-templates) imported into their Superset automatically.SupersetServicealready has login/CSRF/retry plumbing but no import capability — this adds it.What
SupersetService.import_dashboard(bundle_zip, passwords=None, overwrite=True)— wrapsPOST /api/v1/dashboard/import/with the service's existing_make_request_with_retry, CSRF token, Referer, and session-cookie handling.overwrite=Truemakes re-provisioning idempotent.databases/*.yamlsqlalchemy_uri anddatasets/*.yamlschema to the org's warehouse before calling (reference implementation:scripts/import_dashboards.pyin dalgo-dashboard-templates);passwordsmaps database yaml paths to connection passwords since Superset never exports them.TestSupersetServicestyle; all 10 pass.Follow-up (separate PR)
The enablement flow (
POST /api/dalgo_metrics/enable/: ensure package in org repo's packages.yml → write vars → dbt run → import bundles), per docs/ddp_backend_integration.md.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Supersedes #1426 (reopened from a fork per contribution workflow).