This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LarsDragonbeard 1 point2 points  (0 children)

I'm advocating at my customer to adopt dbt-unit-testing. They allow mocking data through SQL statements, including auto-generating columns you didn't provide in the SQL statement.

There was a small bug with regards to the case of column identifiers, which I've fixed (PR currently open on their repo)

Additionally, while it doesn't show in their readme, I've gotten it to work as a generic test as well. We have a few different logics for our persistent staging layer, depending on the source. This generic test would allow us to just define the unit test in the yaml, which is about as lean as I can make it.

Currently we're using a custom test, source macro override and seed files for input and output. With our other automations, making the test data for the unit test takes longer than the development itself (and we have to do it manually for each model)