rilldata / rill

Rill is a tool for effortlessly transforming data sets into powerful, opinionated dashboards using SQL. BI-as-code.
https://www.rilldata.com
Apache License 2.0
1.73k stars 117 forks source link

fix: autogenerate metrics indentation #6091

Closed AdityaHegde closed 1 day ago

AdityaHegde commented 1 week ago

We are generating metrics with additional spaces. Also name is missing in dimensioins.

# Metrics view YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/dashboards

version: 1
type: metrics_view

display_name: Ad Bids
model: ad_bids
timeseries: timestamp

dimensions:
  - 
    display_name: Publisher
    column: publisher
  - 
    display_name: Domain
    column: domain

measures:
  - name: total_records

    display_name: Total records
    expression: COUNT(*)
    description: ""
    format_preset: humanize
  - name: bid_price_sum

    display_name: Sum of Bid Price
    expression: SUM(bid_price)
    description: ""
    format_preset: humanize

Removing the new line before display_name and adding after type instead.

After,

# Metrics view YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/dashboards

version: 1
type: metrics_view 

display_name: Ad Bids
model: ad_bids
timeseries: timestamp

dimensions:
  - name: publisher
    display_name: Publisher
    column: publisher
  - name: domain
    display_name: Domain
    column: domain

measures:
  - name: total_records
    display_name: Total records
    expression: COUNT(*)
    description: ""
    format_preset: humanize
  - name: bid_price_sum
    display_name: Sum of Bid Price
    expression: SUM(bid_price)
    description: ""
    format_preset: humanize