Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Inconsistent label requirements between metrics #1463

Open
2 tasks done
siljamardla opened this issue Oct 17, 2024 · 0 comments
Open
2 tasks done

[Bug] Inconsistent label requirements between metrics #1463

siljamardla opened this issue Oct 17, 2024 · 0 comments
Labels
bug Something isn't working triage Tasks that need to be triaged

Comments

@siljamardla
Copy link

Is this a new bug in metricflow?

  • I believe this is a new bug in metricflow
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When you define a metric via create_metric: true you do not have to specify the label property. This is valid configuration:

semantic_models:
  - name: fact_order_event
    model: ref('fact_order_event')
    defaults:
      agg_time_dimension: order_event_created_date
    entities:
      - name: order_event
        expr: order_event_id
        type: primary
    measures:
      - name: count_order_events
        expr: 1
        agg: sum
        create_metric: true
    dimensions:
      - name: order_event_created_date
        type: time
        type_params:
          time_granularity: day
      - name: event_type
        type: categorical

When you add another metric, defined independently in YML, for example:

metrics:
  - name: count_order_rescheduled_events
    type: simple
    type_params:
      measure: count_order_events
    filter: |
      {{ Dimension('order_event__event_type') }} = 'order_rescheduled'

You will get a parsing error: 'label' is a required property

Expected Behavior

Do not require the label property on metrics either.
Without a label all the semantic layer users (documentation sites, metrics catalogs, BI tools) will default to the metric name.
Regardless of where metrics get defined, they have similar properties.

Steps To Reproduce

Try this on any semantic model.

Relevant log output

No response

Environment

- OS: Mac
- Python: 3.11
- dbt: 1.8
- metricflow: 0.206.0

Which database are you using?

other (mention it in "Additional Context")

Additional Context

Databricks/Spark

@siljamardla siljamardla added bug Something isn't working triage Tasks that need to be triaged labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Tasks that need to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant