Skip to content

feat: standardize silver/gold field names, fix dashboard KPIs, add total_orders#34

Merged
andre-salvati merged 4 commits into
mainfrom
feat/field-standardization-and-dashboard-kpi
Jun 8, 2026
Merged

feat: standardize silver/gold field names, fix dashboard KPIs, add total_orders#34
andre-salvati merged 4 commits into
mainfrom
feat/field-standardization-and-dashboard-kpi

Conversation

@andre-salvati

Copy link
Copy Markdown
Owner

Summary

  • Dropped ds_kpi dashboard dataset; KPI counters (Total Value, Total Orders, Number of Customers) now bind to ds_orders so all five filters update them. Added a third KPI tile for Total Orders.
  • Standardized field names across silver (curated.order_enriched) and gold (report.order_agg): {entity}_id suffix, entity-qualified names, item_* prefix for item-level fields, no abbreviations; date cast to DateType in silver. Added order_enriched_schema and order_agg_schema to commonSchemas.py as the canonical schemas for those layers.
  • Added total_orders (COUNT DISTINCT order_id) to report.order_agg and the dashboard.

Test plan

  • Unit tests pass (make test)
  • Integration tests pass in dev (make run env=dev)
  • prod.report.order_agg and prod.report.order_agg_sdp dropped and recreated via make deploy env=prod + prod integration run
  • SELECT grants re-applied on new prod tables
  • Code review findings addressed (qualified df_order["date"] in join select, removed unused imports, added total_orders load-test assertion, fixed stale error message)

🤖 Generated with Claude Code

andre-salvati added a commit that referenced this pull request Jun 5, 2026
andre-salvati and others added 3 commits June 5, 2026 17:26
…tal_orders

Drop ds_kpi dataset from the dashboard — KPI counters (Total Value, Total Orders,
Number of Customers) now bind to ds_orders so all five filters update them.
Number of Orders removed (no order_id in gold layer).

Standardize field names across silver (curated.order_enriched) and gold
(report.order_agg) per three rules: {entity}_id suffix, entity-qualified names,
item_* prefix for item-level fields, no abbreviations. date cast to DateType in
silver so the type coercion lives in the right layer.

Add total_orders (COUNT DISTINCT order_id) to report.order_agg and a third KPI
tile on the dashboard.

commonSchemas.py now defines order_enriched_schema and order_agg_schema as the
canonical schemas for silver and gold; tests import from there instead of
inlining StructType definitions.

Also fix pre-existing unit_test_sdp.py bug where df_order tuples were missing
product_id and prod_category_id (4 values vs 6-field schema).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Qualify df_order["date"] in enrich_order() joins (was unqualified F.col("date"),
  inconsistent with all other explicit DataFrame refs in the same select)
- Remove unused pyspark.sql.types import block in unit_test_sdp.py
- Add total_orders=40 assertion to _validate_load_test; fix stale error message
  that still referenced old column name total_qty

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@andre-salvati andre-salvati force-pushed the feat/field-standardization-and-dashboard-kpi branch from 4a3b244 to 48b4bb3 Compare June 5, 2026 20:26
@andre-salvati andre-salvati merged commit aec82ab into main Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant