The problem I’m having
When adding two entries of macros in property.yml, dbt compile has the following complain:
02:17:51 Encountered an error:
Compilation Error
dbt found two macros named "macro2" in the project "xxx".
To fix this error, rename or remove one of the following macros:
- macros/utils/a_file_with_2_macros_defined.sql
- macros/utils/a_file_with_2_macros_defined.sql
The context of why I’m trying to do this
Initially there was only 1 macro macro1 defined in macros/utils/a_file_with_2_macros_defined.sql and the property.yml is like below and everything works just fine.
version: 2
macros:
- name: macro1
description: ""
arguments: ""
Then I added an additional macro macro2 to the same sql file and the property.yml file is changed to something below. But dbt compile starts to pop up the complains. If I remove the entry from property.yml file, everything works just fine and the data model consuming the new macro also works fine.
Anyone has any clue on what’s going on here? I’m pretty sure I don’t have two macros with the same name in my project.
version: 2
macros:
- name: macro1
description: ""
arguments: ""
- name: macro2
description: ""
arguments: ""