Skip to content

[AIA-223] Reject column_type aliases with actionable errors - #259

Open
sophiascaglioni-whoop wants to merge 1 commit into
mainfrom
fix/measure-column-type-alias
Open

sophiascaglioni-whoop wants to merge 1 commit into
mainfrom
fix/measure-column-type-alias

Conversation

@sophiascaglioni-whoop

@sophiascaglioni-whoop sophiascaglioni-whoop commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Remove all column_type aliases from get_column_type() so invalid values are no longer silently normalized:
    • measure, metric (previously normalized to fact)
    • timestamp, time, date (previously normalized to time_dimension)
  • Add COLUMN_TYPE_ALIASES map to shared/constants.py for powering "Did you mean?" suggestions
  • Add sm_skipped_columns bucket to the parser so columns with invalid column_type are passed through to the validator instead of being silently dropped
  • Validator now checks skipped columns and emits errors with alias suggestions (e.g. "Did you mean: 'fact'?" or "Did you mean: 'time_dimension'?")
  • Add tests for get_column_type() rejecting all aliases, and for validation error suggestions

Closes #257

Why these are invalid

Snowflake semantic views only support three column kinds: DIMENSION, FACT, and METRIC (SHOW COLUMNS docs, DESCRIBE SEMANTIC VIEW docs).

SST maps these to three valid column_type values: dimension, fact, time_dimension. The time_dimension type is a YAML-only concept that maps to a regular DIMENSION in the deployed semantic view (YAML vs DDL docs):

Time dimensions: YAML only. A separate category for date/timestamp columns. DDL declares them as regular dimensions.

Values like measure, metric, timestamp, time, and date are not valid Snowflake semantic view column types. They are common in other BI tools (Looker, dbt metrics) which is why users write them, but SST should reject them with a clear suggestion rather than silently dropping the column.

Test plan

  • get_column_type() returns "" for measure, metric, timestamp, time, date (new tests)
  • Validation produces error with "Did you mean: 'fact'?" for measure/metric (new test)
  • Validation produces error with "Did you mean: 'time_dimension'?" for timestamp/time/date (new test)
  • Existing typo tests still pass (dimenson, fac, tim_dimension)
  • All 1911 unit tests pass
  • Verified against analytics-dbt: sst validate now surfaces errors for columns with column_type: measure and column_type: timestamp

@sophiascaglioni-whoop
sophiascaglioni-whoop force-pushed the fix/measure-column-type-alias branch 2 times, most recently from 63f59c3 to 437cfb9 Compare October 9, 2026 14:40
@sophiascaglioni-whoop sophiascaglioni-whoop changed the title [SST-257] Reject column_type measure/metric with actionable error [SST-257] Reject column_type aliases with actionable errors Oct 9, 2026
Remove all column_type aliases from get_column_type() so invalid
values are no longer silently normalized. Affected aliases:
- measure, metric (previously normalized to fact)
- timestamp, time, date (previously normalized to time_dimension)

Add COLUMN_TYPE_ALIASES map to shared/constants.py to power "Did you
mean?" suggestions in validation errors.

Pass columns with invalid column_type through to the validator via a
new sm_skipped_columns bucket so they are not silently dropped during
parsing. The validator now checks skipped columns and emits errors
with alias suggestions.

Closes #257
@sophiascaglioni-whoop
sophiascaglioni-whoop force-pushed the fix/measure-column-type-alias branch from 437cfb9 to fdff8a2 Compare October 9, 2026 14:56
@sophiascaglioni-whoop sophiascaglioni-whoop changed the title [SST-257] Reject column_type aliases with actionable errors [AIA-223] Reject column_type aliases with actionable errors Oct 9, 2026

This branch has not been deployed

No deployments
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.

[Bug]: column_type: measure silently excluded during parsing despite being accepted by get_column_type()

1 participant