-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError while using deferred flag and model filters #2875
Comments
Oh boy. Thanks for the repro instructions @nave91, I've been able to replicate this error locally in an even simpler project. I've confirmed that the error results from
The error crops up here, where dbt tries to infer the backward edges of the deferred model and then trips over its missing source key: What are our options here? I think it's either one of the following:
This error is rare in the "Slim CI" use case because it only crops up if you exclude modified models from selection criteria. It's much more common to run all |
Update: this error also crops up for ephemeral models that have been deleted from the project, but which are understood to have edges within the comparison manifest. I think our best bet here is to handle the missing key as gracefully as possible, and move on. |
Captain's log, 12/14/20, 9:48 pm: Per #2954, KeyError also appears when a schema test which uses its arguments to construct its
|
Describe the bug
When the current run isn't aware of a source that exists in deferring run and when we specify a model filter, the
dbt run
command fails with aKeyError: <unaware_source_id>
. I thinkdbt run
should successfully complete or if its a configuration error it should give a more descriptive error statement.Steps To Reproduce
dbt -d run --models config.materialized:table,state:modified+ --defer --state ./deferring_target
which fails with an error.dbt -d run --models state:modified+ --defer --state ./deferring_target
passes without any errors.To recreate
./deferring_target
:dbt run
and copy the target directory.Expected behavior
The run should complete without any errors or a more descriptive error when we specify model filters like
config.materialized:table
.Screenshots and log output
System information
Which database are you using dbt with?
The output of
dbt --version
:The operating system you're using:
MacOs Catalina 10.15.7
The output of
python --version
:Python 3.8.2
Additional context
The text was updated successfully, but these errors were encountered: