mistercrunch opened a new pull request, #34346: URL: https://github.com/apache/superset/pull/34346
## Summary Migrates Superset's example data system from Python-based scripts to YAML configuration files, providing a cleaner, more maintainable approach to managing example datasets, charts, and dashboards. ## Key Changes ### 🔄 Migration to YAML Format - Converted 9 Python example modules to YAML configurations - Exported existing examples from database and added as YAML files: - 11 dashboards (USA Births Names, World Bank's Data, etc.) - 115 charts - 25 datasets - Moved test-specific fixtures to `tests/fixtures/examples/` - Removed theme_id from dashboard exports for compatibility ### 🎛️ New CLI Structure - **New command group**: `superset examples` with subcommands: - `load` - Load example data (replaces `load-examples`) - `clear-old` - Remove old Python-based examples - `clear` - Placeholder for future YAML clearing - `reload` - Clear and reload in one command - **Backwards compatibility**: `superset load-examples` still works with deprecation warning - **Safety mechanism**: Detects old examples and preserves them to avoid data loss ### 🐛 Fixes - Fixed JSON data loading - examples can now load `.json.gz` files from CDN - Fixed Docker compose configuration for isolated development - Fixed webpack WebSocket configuration for different ports ### 📊 Enhanced Logging - Import operations now log what's being created vs updated: - "Creating new dashboard: Sales Dashboard" - "Updating existing chart: World's Population" - Provides clear visibility into the import process ### 🏗️ Architecture Improvements - Moved import logging to individual import functions (DRY principle) - Non-destructive migration approach - no user data is deleted - Deterministic UUID generation for consistent example data ## Testing - Tested migration from old Python examples to new YAML format - Verified safety mechanism prevents accidental data overwrites - Confirmed backwards compatibility with deprecated command - All pre-commit checks pass ## Documentation - Updated installation docs to use new CLI commands - Added deprecation notice to UPDATING.md - Updated development documentation ## Breaking Changes None - the old `load-examples` command continues to work with a deprecation warning. ## Migration Path For users with existing Python-based examples: 1. Run `superset examples clear-old --confirm` to remove old examples 2. Run `superset examples load` to load new YAML-based examples <!--- Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/ Example: fix(dashboard): load charts correctly --> ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> ### TESTING INSTRUCTIONS <!--- Required! What steps can be taken to manually verify the changes? --> ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] 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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org