Files
superset2/superset/examples/configs/dashboards/Misc_Charts.yaml
Maxime Beauchemin 48d8c91b19 feat: migrate examples from Python to YAML format with enhanced CLI
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.

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

- 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

- 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

- 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

- 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

- Updated installation docs to use new CLI commands
- Added deprecation notice to UPDATING.md
- Updated development documentation

None - the old `load-examples` command continues to work with a deprecation warning.

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
2025-07-29 22:23:52 -07:00

84 lines
1.6 KiB
YAML

dashboard_title: Misc Charts
description: null
css: null
slug: misc_charts
certified_by: null
certification_details: null
published: false
uuid: 55a4fe9f-2682-4b0d-84c7-49ded4be11db
position:
CHART-HJOYVMV0E7:
children: []
id: CHART-HJOYVMV0E7
meta:
chartId: 30
height: 69
sliceName: OSM Long/Lat
uuid: a4e90860-c8f5-4c50-8c04-06b2e144809c
width: 4
parents:
- ROOT_ID
- GRID_ID
- ROW-S1MK4M4A4X
- COLUMN-ByUFVf40EQ
type: CHART
CHART-S1WYNz4AVX:
children: []
id: CHART-S1WYNz4AVX
meta:
chartId: 10
height: 69
sliceName: Parallel Coordinates
uuid: 041377c4-0ca9-4a40-8abd-befcd137c0dc
width: 4
parents:
- ROOT_ID
- GRID_ID
- ROW-SytNzNA4X
type: CHART
CHART-rkgF4G4A4X:
children: []
id: CHART-rkgF4G4A4X
meta:
chartId: 31
height: 69
sliceName: Birth in France by department in 2016
uuid: 6bd584f1-0ef5-44fc-8a05-61400f83bb62
width: 4
parents:
- ROOT_ID
- GRID_ID
- ROW-SytNzNA4X
type: CHART
DASHBOARD_VERSION_KEY: v2
GRID_ID:
children:
- ROW-SytNzNA4X
id: GRID_ID
parents:
- ROOT_ID
type: GRID
HEADER_ID:
id: HEADER_ID
meta:
text: Misc Charts
type: HEADER
ROOT_ID:
children:
- GRID_ID
id: ROOT_ID
type: ROOT
ROW-SytNzNA4X:
children:
- CHART-rkgF4G4A4X
- CHART-S1WYNz4AVX
- CHART-HJOYVMV0E7
id: ROW-SytNzNA4X
meta:
background: BACKGROUND_TRANSPARENT
parents:
- ROOT_ID
- GRID_ID
type: ROW
version: 1.0.0