I’m trying to add a test to a dbt model. However there’s an error while running dbt test
. I tried to strip down the test to a minimal but still couldn’t find where the problem is. The error says
Compilation error in test count_my_model_ (modelsmy_projectmart_my_project_mart_models.yaml) 'bool' object is not callable
How to solve this error?
The project structure is:
dbt_main
-- |marcos
|models
--|my_project
--|mart
--_my_project_mart_models.yaml
--my_model.sql
|target
|tests
--|generic
--| count.sql
|dbt_project.yml
In the _my_project_mart_models.yaml
:
models:
- name: my_model
tests:
- count
columns:
- name: col1
data_type: string
- name: id
data_type: string
and the count.sql looks like this:
{% test count (model) %}
select *
from {{ model }}
where id is not null
{% endtest %}