-
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
[Bug] Runtime Error in unit_test when using versioned models #10623
Comments
Thanks for reaching out @marcilj ! Does this cover the scenario that you're describing? #10528 (comment) |
Yes @dbeatty10 I think the example you provided covered the scenario I'm describing except that in my scenario the There seems to be a little difference from what I'm experiencing vs what's describe in the issue #10528. The error I get is linked to the generated SQL
Hope that helps. Thank you very much for the quick response btw. |
Thanks @marcilj, that does help 👍 See below for a slightly simplified reproducible example ("reprex"). Could you try it out and verify that it replicates the issue you are seeing? And then can you try adding
|
Hey @dbeatty10 I've reproduce this example locally, and here's what I got Example with
|
Update.Did upgrade to
And got a successful runs for inputs
and
So it seems like upgrading to Last test. Updagred to 1.8.5 failedSeems like the issue was resolved from 1.8.5 to 1.8.6. Running
Well glad that this was resolved by only upgrading the version to Thank for you help @dbeatty10 |
Sounds like this may be fixed and we can close this out? |
Is this a new bug in dbt-core?
Current Behavior
The problem I'm having
DBT Unit Test is not able to find the version 2 of my model.
Let's take an example of a model I'm trying to test.
(This is an example, I know
model_with_version
is not selected in any way in this query)With this unit test
If I run the command
dbt test --select "my_model_name,test_type:unit"
dbt will returnI've make sure the version 2 exist.
I can easily run
dbt run -m model_with_version.v2
and it run successfully.Note that the
latest
version is currently version 1, in my YAML file.I've also tried to add the pin version to the
ref
in the unit test yml file.Like this
- input: ref('model_with_version', v=2)
But ended up with this error.
The context of why I'm trying to do this
I'm trying to configure a unit test for a model that uses DBT version.
What I've already tried
input
.Some example code or error messages
More Informations
If I configure the
input
as- input: ref('model_with_version')
then in the query I can see that the query generate the static inputsbut my code want to select from
Which fails.
Expected Behavior
I shouldn't receive any errors as the
__DBT__CTE__STG_FIGMENT_VALIDATOR_REPOSITORY_V2
CTE should be created instead of__DBT__CTE__STG_FIGMENT_VALIDATOR_REPOSITORY
Steps To Reproduce
latest_version
.alias:model_with_version_v1
)model_with_version_v2
.- input: ref('model_with_version', v='2')
__DBT__CTE__MODEL_WITH_VERSION
, but the one in the actual query thatselect * from
has the version number after it__DBT__CTE__MODEL_WITH_VERSION_V2
.select * from __DBT__CTE__MODEL_WITH_VERSION_V2
doesn't exist because the CTE that was created is called__DBT__CTE__MODEL_WITH_VERSION
this break the test.Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: