3.0 KiB
3.0 KiB
Quickstart: Dataset Lifecycle Workspace
Prerequisites
- Backend virtualenv:
cd backend && source .venv/bin/activate - Frontend deps:
cd frontend && npm install - Superset environment configured (dev via http://localhost:8100)
- RBAC: user must have
plugin:migration:READpermission
Backend Verification
# Run backend tests
cd backend && source .venv/bin/activate && python -m pytest -v
# Lint
python -m ruff check .
# Run dev server
uvicorn src.main:app --reload --port 8000
Frontend Verification
# Run frontend tests
cd frontend && npm run test
# Lint
cd frontend && npm run lint
# Build check
cd frontend && npm run build
# Dev server (requires backend on :8000)
cd frontend && npm run dev
Feature-Specific Verification
Backend API Tests
# Test metrics in dataset detail response
curl -s http://localhost:8100/api/datasets/32?env_id=dev | jq '.metrics, .metric_count'
# Test stats counts in dataset list
curl -s 'http://localhost:8100/api/datasets?env_id=dev&page=1&page_size=5' | jq '.stats'
# Test column description inline-edit
curl -s -X PUT http://localhost:8100/api/datasets/32/columns/851/description \
-H 'Content-Type: application/json' \
-d '{"description":"Updated via API"}'
# Test metric description inline-edit
curl -s -X PUT http://localhost:8100/api/datasets/32/metrics/70/description \
-H 'Content-Type: application/json' \
-d '{"description":"Count of all records"}'
Frontend Component Tests
# Run dataset-specific component tests
cd frontend && npx vitest run src/routes/datasets/ --reporter=verbose
Browser Validation
- Open
http://localhost:8100/datasets - Verify Stats Bar shows 4 tiles with counts
- Click each tile — list filters correctly
- Click a dataset card — detail panel loads with columns + metrics
- Click ✏️ on a column — textarea appears, type description, save
- Verify description persists after save
- Check 2+ checkboxes — bottom panel appears
- Click "Map Columns" — modal opens
Docker
docker compose up --build
# Visit http://localhost:8100/datasets
Key Files Changed/Created
| File | Change |
|---|---|
backend/src/api/routes/datasets.py |
+MetricItem, +StatsCounts, +2 endpoints, MOD DatasetsResponse/DatasetDetailResponse |
backend/src/core/superset_client/_datasets.py |
+metrics extraction in get_dataset_detail |
backend/src/core/task_manager.py |
+dataset.updated WebSocket event on task complete |
frontend/src/routes/datasets/+page.svelte |
REWRITE (split-view orchestrator) |
frontend/src/routes/datasets/StatsBar.svelte |
NEW |
frontend/src/routes/datasets/DatasetList.svelte |
NEW |
frontend/src/routes/datasets/DatasetPreview.svelte |
NEW |
frontend/src/routes/datasets/ColumnsTable.svelte |
NEW |
frontend/src/routes/datasets/MetricsTable.svelte |
NEW |
frontend/src/lib/i18n/locales/en/datasets.json |
+11 keys |
frontend/src/lib/i18n/locales/ru/datasets.json |
+11 keys |