dbt-labs / dbt-semantic-interfaces

The shared semantic layer definitions that dbt-core and MetricFlow use.
Apache License 2.0
66 stars 13 forks source link

[Bug] Inconsistency between time dimension Jinja objects for `time_granularity_name` #306

Closed courtneyholcomb closed 2 months ago

courtneyholcomb commented 2 months ago

Is this a new bug in dbt-semantic-interfaces?

Current Behavior

Currently, the protocol for QueryInterfaceTimeDimensionFactory requires time_granularity_name to be set. This is inconsistent with other interfaces, where granularity is not required and can be resolved at query time.

Expected Behavior

I should be able to use a time dimension like {{ TimeDimension('metric_time') }} in all interfaces & parameters without error.

Steps To Reproduce

Try running a saved query that uses a group by parameter like: {{ TimeDimension('metric_time') }} You should see an error.

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:
- dbt-semantic-interfaces:

Additional Context

No response