Closed Startouf closed 5 months ago
This issue is pretty huge, because it also affects your ability to dbt compile
after creating an exposures file in your models/
directory. We get the following error when running dbt compile
after successfully creating models/exposures.yml
:
Compilation Error
expected token 'end of print statement', got ':'
line 8
{{snippet: NameOfSnippet}}
Edit: There are two issues with this {{}}
template string, the :
and the whitespace between non-whitespace characters, which are both standard for snippets in Metabase. Adding a post-processing step to fix this file is non-trivial... the fact that exposures
can create invalid yaml seems like a big issue.
I found that if whatever is inside the brackets is quoted, it just works.
{{'like so'}}
{{'and colons: also work'}}
This happens when referencing other metabase questions in metabase
In the metabase exposures yml here is an extract of a problematic line
I believe dbt tries to interpolate the metabase question references as jinja expression, thus causing problems
This is likely to cause problems with every metabase custom variable/reference wrapped under
{{}}
Is there a way to either post-process the exposures.yml to escape those characters, or find a way to disable dbt jinja interpolation for metabase exposures ?