-
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
Discrepancy between the number of built and executed objects in dbt build
with unit tests
#11185
Comments
Thanks for reporting this @sadeka4 ! I suspect that there is bug in dbt and 208 is an overcount and 188 is actually the correct number of objects to build. See below for some simplified examples showing an overcount. ReprexCreate these files:
select 1 as id
select 1 as id
models:
- name: my_model_1
config:
tags: ["daily", "weekly"]
columns:
- name: id
tests:
- unique
unit_tests:
- name: test_1
model: my_model_1
given: []
expect:
rows:
- {id: 1}
- name: test_2
model: my_model_2
given: []
expect:
rows:
- {id: 1} Run these commands: dbt list -q
dbt list -q | wc -l
dbt list -q --select tag:daily
dbt list -q --select tag:daily | wc -l See that there are 5 and 3 nodes selected, respectively. Run these commands:
Here's the output:
See that the first says "5 of 9". The 5 is what we expect and the 9 is too many! The second says "3 of 4". Likewise, the 3 is what we expect and the 4 is one too much. Relevant codeI think a relevant area of the code is here: dbt-core/core/dbt/task/build.py Line 93 in 8a8857a
I think that some nodes are coverted in both |
dbt build
with unit tests
Thank you, @dbeatty10 . Makes sense now. |
Although it doesn't appear so on the surface, I think might be related to #10267. |
Is this a new bug in dbt-core?
Current Behavior
While executing the DBT build command, I can see contradictory outputs.
e.g., I can see this.
"188 of 208 OK created sql view model my_dataset.fct_missed_sales_score_daily_v"
However, the execution stops after the 188th object as reported above.
And DBT reports the following afterwards.
"Done. PASS=188 WARN=0 ERROR=0 SKIP=0 TOTAL=188"
Just wondering: why the execution stops after the 188th object? What are the rest of the objects?
Any help would be highly appreciated!
Thanks!
Expected Behavior
I believe the the number of objects should be the same in both cases.
I'd like to see all the 208 objects executed and reported while running the dbt build command.
Steps To Reproduce
In our DBT project, we have models, tests, unit tests, seeds and snapshots. And the command looks like this.
"dbt build --target my_core --select tag:daily tag:intra-day"
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: