Skip to content

[Audit] Add primary key tests to dim_dates #101

Description

@daria-sukhareva

Context

dim_dates has no not_null or unique data test on date_day / date_id. The MetricFlow granularity: day config is not a data quality assertion — it tells the semantic layer how to interpret the time column, but it does not verify that the column contains no duplicates or nulls.

A date dimension with duplicate or null rows will cause fan-out in any fact-to-dim join that touches the time spine, silently inflating every time-series metric in the project.

This is a small, standalone fix but its blast radius if left unaddressed is large.

Acceptance criteria

  • date_day (or date_id, whichever is the primary key) has a not_null test
  • date_day (or date_id) has a unique test
  • If both date_day and date_id exist, it is clear in the column docs which one is the primary key and only the primary key column has the uniqueness test
  • dbt test --select dim_dates passes with no failures
  • No SQL changes to the model are required — tests only

Metadata

Metadata

Assignees

No one assigned

    Labels

    kwwhat-auditKimball compliance audit findings

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions