Skip to main content

Unique project resource names

require_unique_project_resource_namesdbt Latestdbt Core
Introduced2025.121.11.0
Matured (default → true)
Removed
Loading table...

The require_unique_project_resource_names flag enforces uniqueness of resource names within the same package. dbt resources such as models, seeds, snapshots, analyses, tests, and functions share a common namespace. When two resources in the same package have the same name, dbt must decide which one a ref() or source() refers to. Previously, this check was not always enforced, which meant duplicate names could result in dbt referencing the wrong resource.

The require_unique_project_resource_names flag is set to false by default. With this setting, if two unversioned resources in the same package share the same name, dbt continues to run and raises a DuplicateNameDistinctNodeTypesDeprecation warning. When set to true, dbt raises a DuplicateResourceNameError error.

For example, if your project contains a model and a seed named sales:

models/sales.sql
seeds/sales.csv

And a model contains:

select * from {{ ref('sales') }}

When the flag is set to true, dbt will raise:

DuplicateResourceNameError: Found resources with the same name 'sales' in package 'project': 'model.project.sales' and 'seed.project.sales'. Please update one of the resources to have a unique name.

When this error is raised, rename one of the resources or refactor the project structure to avoid name conflicts.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0