-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
dbt-labs/dbt-adapters
#1631Labels
enhancementNew feature or requestNew feature or requesthelp_wantedTrickier changes, with a clear starting point, good for previous/experienced contributorsTrickier changes, with a clear starting point, good for previous/experienced contributors
Description
Is this a new bug in dbt-core?
- I believe this is a new bug in dbt-core
- I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
Reported from a user in Community Slack.
These two listed files contain duplicate macros, but confuse users because we list the file names, not the macros. Not only that, but in my repro I discovered that we always say "two" instead of how many duplicates actually exist and only report the first two files that conflict. That last bit may not be fixable given that we error out when it happens, but I propose that ideally we should say something like:
dbt found [n] macros named "cents_to_dollars" in the project "jaffle shop".
To fix this error, rename or remove duplicates, they can be found in these files:
- macros/hi_doug.sql
- macros/hi_jer.sql
- macros/cents_to_dollars.sqlMy repro error from straight Core:

User from Slack's error (looks like dbt Power User):

Expected Behavior
I would expect dbt to give me a clearer error re which files contain all the duplicate macros
Steps To Reproduce
- In dbt Core
- Create two or three macros in different files with the same name
- Run a
dbt compile
Relevant log output
dbt found two macros named "some_custom macro_with_sql" in the project "uft_dbt". To fix this error, rename or remove one of the following macros: - macros get_incremental_merge_insert_sq.sql - macros get _incremental_merge_update_sql.sql
Environment
- OS: MacOS 14
- Python: 3.11.8
- dbt: 1.8.0-b3Which database adapter are you using with dbt?
snowflake
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp_wantedTrickier changes, with a clear starting point, good for previous/experienced contributorsTrickier changes, with a clear starting point, good for previous/experienced contributors