[Feature] unit testing: dbt should tell me why it couldn't get columns of this (the model doesn't yet exist) on incremental models #10844
Labels
enhancement
New feature or request
triage
unit tests
Issues related to built-in dbt unit testing functionality
Is this your first time submitting a feature request?
Describe the feature
This suggestion is very similar to #10014 with the difference that this is specifically about incremental models where the model itself not yet has been built.
I tried to make an unit test on an incremental model testing the incremental functionality of the model with
is_incremental: true
where I mocked the data of the current state of the model with- input: this
If the model has never been built in the current profile and I use
dbt build
the test fails because unit tests run before the models run. I therefore get an error ofNot able to get columns for unit test... because the relation doesn't exist
.This I think will be confusing for users checking out my repository and building it from scratch. It might also be problematic in CI pipelines where the model has never been built before.
Describe alternatives you've considered
I have considered two solutions to this:
dbt run --empty
to create needed schemas for the test.run -s my_model --empty
if this happens automatically and then run the unit test.Who will this benefit?
Users of the unittest functionality on incremental models
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: