dbt-labs / dbt-labs/dbt

[CT-3166] [Bug] [Spike+] State modified --select state:modified ignores new sources

Open
#8,727 3 comments 0 reactions 0 assignees View on GitHub
engine:v1 Refinement state: modified type:bug
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

This issue is targeting discrepancy between how `--select state:modified` treats sources and models.

Running `dbt ls --select state:modified --state ./local/master_manifest` will show all the new and modified `models`, but it will show only modified `sources`.

In the pictures below, I am showing `--select state:modified` vs `--select state:new` which for the models it shows new models in both cases (modified & new), but for sources, the new source is shown on when `state:new` is specified.

image

image

### Expected Behavior

I would expect running `dbt ls --select state:modified --state ./local/master_manifest` to report all the changed and new sources

Also, the documentation says `--select state:modified` should encompass all other options of `state` selector.

### Steps To Reproduce

1. Have a DBT project.
2. Create a dbt model source.
3. Create a manifest with this source.
4. Store this manifest in a separate location so, you can use it for `state` comparison.
5. Add a new source and change the first source.
6. Run `dbt ls --select state:modified --state ./path/to/stored/manifest/dir/`
7. See the result is showing a modified source, but missing new source

### Relevant log output

_No response_

### Environment

```markdown
- OS: Mac, Linux in Docker
- Python: 3.8
- dbt: 1.5.0 & 1.6.3
```

### Which database adapter are you using with dbt?

spark

### Additional Context

Workaround for this issue is running `dbt ls --select state:modified --select state:new --state ./local/master_manifest`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.