macro-paths
dbt_project.yml
macro-paths: [directorypath]
Definition
Optionally specify a custom list of directories where macros are located. Note that you cannot co-locate models and macros.
Default
By default, dbt will search for macros in a directory named macros
. For example, macro-paths: ["macros"]
.
macro-paths
must be relative to the location of your dbt_project.yml
file. Avoid using absolute paths like /Users/username/project/macros
, as it will lead to unexpected behavior and outcomes.
-
✅ Do
- Use relative path:
macro-paths: ["macros"]
- Use relative path:
-
❌ Don't:
- Avoid absolute paths:
macro-paths: ["/Users/username/project/macros"]
- Avoid absolute paths:
Examples
Use a subdirectory named custom_macros
instead of macros
dbt_project.yml
macro-paths: ["custom_macros"]
0