[Bug] File naming on versioned models matters during parse for duplicate detection
- Dominant language
- Rust
- Stars
- 13.8k
- Forks
- 2.6k
- Avg merge
- 21h 31m
- Merged PRs (30d)
- 56
Description
### Is this a new bug in dbt-core?
- [x] I believe this is a new bug in dbt-core
- [x] I have searched the existing issues, and I could not find an existing issue for this bug
### Current Behavior
In a very simple dbt project with versioned models, I have two files defined:
`models/versioned.yml`
```yml
version: 2
models:
- name: versioned
latest_version: 2
description: 'From the versioned schema'
columns:
- name: id
versions:
- v: 1
defined_in: versioned
- v: 2
```
and
`models/versioned_schema_dup.yml`
```yml
models:
- name: versioned
description: "From the versioned schema duplicate"
```
with two models:
`models/versioned.sql`
```yml
SELECT 1 AS id;
```
and
`models/versioned_v2.sql`
```yml
SELECT 2 AS id;
```
```shell
dbt parse --no-partial-parse
```
Depending on the naming of `versioned_schema_dup.yml`, I get varying parse errors. If the name is kept the same, we get:
```
Compilation Error
dbt found two schema.yml entries for the same resource named versioned. Resources and their associated columns may only be described a single time. To fix this, remove the resource entry for versioned in one of these files:
- mine/versioned_schema_dup.yml
mine/versioned.yml
```
If the name of `versioned.yml` is changed to `versioned_schema.yml`, `versioned_2.yml` etc. I get no errors reported.
### Expected Behavior
Consistency between schema.yml errors reported.
### Which database adapter are you using with dbt?
postgres
P.S. Every invocation was run with `--no-partial-parse`
Contributor guide
Assessment
This issue has not been assessed yet.