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

[Feature] Allow specifying saved query group by items with dundered syntax vs the object syntax #260

Open Jstein77 opened 7 months ago

Jstein77 commented 7 months ago

Is this your first time submitting a feature request?

Describe the feature

Currently you need to to use the object syntax to call dimensions in a saved query:

saved_queries:
  - name: new_customer_orders
    description: New customer orders by name and time
    query_params:
      metrics:
        - orders
      group_by:
        - Dimension('customer__customer_name')
        - TimeDimension('metric_time', 'day')
      where:
        - "{{ Dimension('customer__customer_type') }}  = 'new'"
    exports:
      - name: new_customer_orders
        config:
          export_as: table

You should be able to add call dimensions without needing jinja brackets. This is consistent with how you call dimensions in the CLI.

saved_queries:
  - name: new_customer_orders
    description: New customer orders by name and time
    query_params:
      metrics:
        - orders
      group_by:
        - customer__customer_name
        - metric_time__day
      where:
        - "{{ Dimension('customer__customer_type') }}  = 'new'"
    exports:
      - name: new_customer_orders
        config:
          export_as: table

Describe alternatives you've considered

No response

Who will this benefit?

No response

Are you interested in contributing this feature?

No response

Anything else?

No response

plypaul commented 7 months ago

I vaguely recall that we specifically did not want to have the dundered syntax in the configs?