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
I have a metric with a filter defined:
metrics:
- name: "east_coast_order_amount"
description: "Sum of orders from the east coast."
type: simple
label: "test"
type_params:
measures:
- orders
filter: |
{{dimension('location_name')}} in ('Philadelphia')"
When I execute dbt run I get the following error:
Compilation Error
Could not render {{dimension('location_name')}} in ('Philadelphia')
: 'dimension' is undefined
This is likely due to the parser trying to render jinja when it encounters the double curlies, which it shouldn't be doing. If i escape the curlies dbt run succeeds. i.e
metrics:
- name: "east_coast_order_amount"
description: "Sum of orders from the east coast."
type: simple
label: "test"
type_params:
measures:
- orders
filter: |
\{\{dimension('location_name')\}\} in ('Philadelphia')"
Expected Behavior
dbt should parse the filter correctly.
Steps To Reproduce
Define a filter in a semantic model and run dbt run.
Relevant log output
No response
Environment
- OS:
- Python:
- dbt:
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Compilation error when rendering filter in metrics
[CT-2696] Compilation error when rendering filter in metrics
Jun 13, 2023
Is this a new bug in dbt-core?
Current Behavior
I have a metric with a filter defined:
When I execute
dbt run
I get the following error:This is likely due to the parser trying to render jinja when it encounters the double curlies, which it shouldn't be doing. If i escape the curlies dbt run succeeds. i.e
Expected Behavior
dbt should parse the filter correctly.
Steps To Reproduce
Define a filter in a semantic model and run
dbt run
.Relevant log output
No response
Environment
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: