The problem I’m having
Cannot resolve the macro inside my custom dbt package when using dispatch in root dbt_project.yml. I loaded the custom dbt package using dbt deps command. I am using dbt-sqlserver
The context of why I’m trying to do this
I created a custom dbt package which includes only macros. I would like to use it in my dbt projects.
I would like to use dispatch feature in dbt_project.yml but it’s not finding my custom macro.
What I’ve already tried
When I add my custom macros to the macros directory of root project, it’s working but when I try to access using dispatch, it’s not working
Some example code or error messages
I added this into my project > dbt_project.yml file
dispatch:
- macro_namespace: dbt
search_order: ['my_custom_dbt_package','dbt']
My custom dbt package dbt_project.yml file is as follows
name: 'my_custom_dbt_package'
version: '0.1.0'
macro-paths: ["macros"]
My custom macro inside custom package (my_custom_dbt_package > macros > test_log.sql)
contains this macro
{% macro test_log() %}
{{ log("DBT TEST LOG" ) }}
{% endmacro %}
When I test macro from my root project
{{ test_log() }}
I am getting error ‘test_log’ is undefined