refactor: multi-dashboard structural migration
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled
Some checks failed
CI / lint-and-test (pull_request) Has been cancelled
- Rename dbt project from toronto_housing to portfolio - Restructure dbt models into domain subdirectories: - shared/ for cross-domain dimensions (dim_time) - staging/toronto/, intermediate/toronto/, marts/toronto/ - Update SQLAlchemy models for raw_toronto schema - Add explicit cross-schema FK relationships for FactRentals - Namespace figure factories under figures/toronto/ - Namespace notebooks under notebooks/toronto/ - Update Makefile with domain-specific targets and env loading - Update all documentation for multi-dashboard structure This enables adding new dashboard projects (e.g., /football, /energy) without structural conflicts or naming collisions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
26
Makefile
26
Makefile
@@ -1,11 +1,12 @@
|
||||
.PHONY: setup docker-up docker-down db-init load-data seed-data run test dbt-run dbt-test lint format ci deploy clean help logs run-detached etl-toronto
|
||||
.PHONY: setup docker-up docker-down db-init load-data load-all load-toronto load-toronto-only seed-data run test dbt-run dbt-test lint format ci deploy clean help logs run-detached etl-toronto
|
||||
|
||||
# Default target
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
# Environment
|
||||
PYTHON := python3
|
||||
PIP := pip
|
||||
VENV := .venv
|
||||
PYTHON := $(VENV)/bin/python3
|
||||
PIP := $(VENV)/bin/pip
|
||||
DOCKER_COMPOSE := docker compose
|
||||
|
||||
# Architecture detection for Docker images
|
||||
@@ -79,16 +80,23 @@ db-reset: ## Drop and recreate database (DESTRUCTIVE)
|
||||
@sleep 3
|
||||
$(MAKE) db-init
|
||||
|
||||
load-data: ## Load Toronto data from APIs, seed dev data, run dbt
|
||||
# Domain-specific data loading
|
||||
load-toronto: ## Load Toronto data from APIs
|
||||
@echo "$(GREEN)Loading Toronto neighbourhood data...$(NC)"
|
||||
$(PYTHON) scripts/data/load_toronto_data.py
|
||||
@echo "$(GREEN)Seeding development data...$(NC)"
|
||||
@echo "$(GREEN)Seeding Toronto development data...$(NC)"
|
||||
$(PYTHON) scripts/data/seed_amenity_data.py
|
||||
|
||||
load-data-only: ## Load Toronto data without running dbt or seeding
|
||||
load-toronto-only: ## Load Toronto data without running dbt or seeding
|
||||
@echo "$(GREEN)Loading Toronto data (skip dbt)...$(NC)"
|
||||
$(PYTHON) scripts/data/load_toronto_data.py --skip-dbt
|
||||
|
||||
# Aggregate data loading
|
||||
load-data: load-toronto ## Load all project data (currently: Toronto)
|
||||
@echo "$(GREEN)All data loaded!$(NC)"
|
||||
|
||||
load-all: load-data ## Alias for load-data
|
||||
|
||||
seed-data: ## Seed sample development data (amenities, median_age)
|
||||
@echo "$(GREEN)Seeding development data...$(NC)"
|
||||
$(PYTHON) scripts/data/seed_amenity_data.py
|
||||
@@ -119,15 +127,15 @@ test-cov: ## Run pytest with coverage
|
||||
|
||||
dbt-run: ## Run dbt models
|
||||
@echo "$(GREEN)Running dbt models...$(NC)"
|
||||
cd dbt && dbt run --profiles-dir .
|
||||
@set -a && . ./.env && set +a && cd dbt && dbt run --profiles-dir .
|
||||
|
||||
dbt-test: ## Run dbt tests
|
||||
@echo "$(GREEN)Running dbt tests...$(NC)"
|
||||
cd dbt && dbt test --profiles-dir .
|
||||
@set -a && . ./.env && set +a && cd dbt && dbt test --profiles-dir .
|
||||
|
||||
dbt-docs: ## Generate dbt documentation
|
||||
@echo "$(GREEN)Generating dbt docs...$(NC)"
|
||||
cd dbt && dbt docs generate --profiles-dir . && dbt docs serve --profiles-dir .
|
||||
@set -a && . ./.env && set +a && cd dbt && dbt docs generate --profiles-dir . && dbt docs serve --profiles-dir .
|
||||
|
||||
# =============================================================================
|
||||
# Code Quality
|
||||
|
||||
Reference in New Issue
Block a user