v0.2.2
What's new
Added
-
ValidationResult.referenced_columns— populated on successful spec validation; adict[str, list[str]]mapping each spec field to the unqualified column names it references.Nonewhen the spec is invalid.Enables downstream consumers who hold a warehouse connection to verify that every column referenced in a spec is present in the source table before calling
compute().result = metric_spec.validate() if result.valid: print(result.referenced_columns) # {'numerator': ['revenue'], 'denominator': ['impressions'], 'timestamp_col': ['created_at']}
Fields extracted per spec type:
- Metric:
"numerator","denominator"(if set),"timestamp_col","entities"(if set) - Slice leaf:
"values[i].where"(one key per value) - Slice wildcard:
"where" - Slice composite: empty dict
{}
- Metric:
See the changelog and column introspection docs for details.