-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[Bug] Intermittent errors when unit testing versioned models #11139
Comments
@CarrotPapa Thanks for such a nice write-up with detailed listing of your project files, commands, and output 🤩 Intermittent errors are tough to debug! I tried out an example nearly the identical to the one you provided, but I wasn't able to trigger the error. See below for the files I used. I suspect it is some kind of issue related to cached files in your Project files
select 1 as id
select * from {{ ref("table_a") }}
select * from {{ ref("table_a") }}
version: 2
models:
- name: model
latest_version: 1
versions:
- v: 2
defined_in: model_v2
- v: 1
defined_in: model
config:
alias: model
unit_tests:
- name: test_model
model: model
versions:
include:
- 2
given:
- input: ref('table_a')
rows:
- {id: 2}
expect:
rows:
- {id: 2} Ran this command: dbt compile Got this output:
|
Thanks @dbeatty10 for taking a look at the issue. |
I have figured out how to reliably reproduce the intermittent errors. It seems the key is to place the unit tests in a separate directory (e.g.
|
Is this a new bug in dbt-core?
Current Behavior
Encountering an intermittent error during unit testing of versioned models. The error resolved after removing the associated unit tests.
Expected Behavior
When it worked, it looks like the following:
Steps To Reproduce
model.sql:
model_v2.sql:
schema.yml:
test_model.yml:
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: