You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
When you define a metric or metric input measure with a filter list and include Jinja in the list, dbt parse triggers an error. Example YAML:
metrics:
- name: new_customer
description: Unique count of new customers.
label: New Customers
type: simple
type_params:
measure: customers_with_orders
filter:
- "{{ Dimension('customer__customer_type') }} = 'new'"
Running dbt parse in a repo with that metric definition triggers this error:
Compilation Error
Could not render {{ Dimension('customer__customer_type') }} = 'new': 'Dimension' is undefined
Meanwhile, if you apply the same filter as a string (example below), no error will be triggered.
metrics:
- name: new_customer
description: Unique count of new customers.
label: New Customers
type: simple
type_params:
measure: customers_with_orders
filter: "{{ Dimension('customer__customer_type') }} = 'new'"
Expected Behavior
Applying the filter in a list should have the same impact as applying it as a string. Currently this limitation will prevent users from using multiple filters on metrics and metric input measures.
Steps To Reproduce
Add a list-type filter on a metric or a metric input measure in a dbt project
Run dbt parse in the repo
Relevant log output
Output when running dbt parse:
21:05:56 Running with dbt=1.7.3
21:05:56 Registered adapter: duckdb=1.7.0
21:05:56 Encountered an error:
Compilation Error
Could not render {{ Dimension('customer__customer_type') }} = 'new': 'Dimension' is undefined
Is this a new bug in dbt-core?
Current Behavior
When you define a metric or metric input measure with a filter list and include Jinja in the list,
dbt parse
triggers an error. Example YAML:Running
dbt parse
in a repo with that metric definition triggers this error:Meanwhile, if you apply the same filter as a string (example below), no error will be triggered.
Expected Behavior
Applying the filter in a list should have the same impact as applying it as a string. Currently this limitation will prevent users from using multiple filters on metrics and metric input measures.
Steps To Reproduce
dbt parse
in the repoRelevant log output
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
DuckDB
The text was updated successfully, but these errors were encountered: