Open techwithshadab opened 20 hours ago
@techwithshadab The error you’re encountering is due to a naming conflict between the group_by
macros defined in both the dbt_expectations
and dbt_utils
packages. When two macros share the same name in your project, dbt doesn’t know which one to use, leading to a compilation error.
@techwithshadab thanks for opening this issue!
@giuliosmall good point about the potential root cause. But in this case, I'd expect for this to work just fine since the groupby
macro is namespaced to each of the source packages.
For example, this worked for me:
dbt clean
dbt deps
dbt compile -s my_model
Here's the output I got:
$ dbt compile -s my_model
12:28:02 Running with dbt=1.8.6
12:28:04 Registered adapter: snowflake=1.8.3
12:28:04 Found 49 models, 1 seed, 29 data tests, 1003 macros
12:28:04
12:28:06 Concurrency: 10 threads (target='snowflake')
12:28:06
12:28:06 Compiled node 'my_model' is:
select 1 as id
group by 1
-- group by 1
Here's the file that I used
models/my_model.sql
select 1 as id
{{ dbt_utils.group_by(1) }}
@techwithshadab Could you share a simple model file that gives this error for you and also share the commands you used?
Could you also share your dbt_project.yml
file? I'm wondering if you are overriding the macro-paths
config or setting the dispatch
, etc.
Is this a new bug in dbt-core?
Current Behavior
dbt compile is giving Compilation Error
dbt found two macros named "group_by" in the project "media_datalake". To fix this error, rename or remove one of the following macros:
Expected Behavior
dbt compile should run successfully without giving the above error
Steps To Reproduce
Package Version dbt-core==1.8.6 dbt-snowflake==1.8.3
Packages YML file
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response