[Feature] Support Unit Testing on Materialized Views #111
Labels
feature:materialized-views
feature:unit tests
Issues related to built-in dbt unit testing functionality
pkg:dbt-postgres
type:enhancement
New feature or request
Is this a new bug?
Current Behavior
As of dbt v1.8.1, if a model depends upon another model for which
materialized="materialized_view"
, any unit tests on the former model fail with a compilation error:Not able to get columns for unit test X from relation Y because the relation doesn't exist
. If the referenced model is materialized as a table, no error is raised; if the model being tested is a materialized view (and the reference model is a table), no error is raised.Expected Behavior
I would expect unit tests to function regardless of referenced model's materialization. I don't see this listed as a limitation here.
Steps To Reproduce
file:
model1.sql
file:
model2.sql
file:
_unit_tests.yml
$ dbt-postgres test --select test_matview
Relevant log output
Environment
Additional Context
No response
The text was updated successfully, but these errors were encountered: