I would like to use either a call statement
or a run_query
block to fetch the table history for a given delta lake table and use the results in a test (the use case is checking the table size as of a given version and seeing if it has changed unexpectedly).
Unfortunately if the table doesn’t exist in one’s dev schema, dbt compile
throws an error because the call statement
query throws a table does not exist
error, so this breaks local development for my team.
I’d like to do something like this but none of the documentation or examples I’ve seen indicate if/how to do so:
try
acall statement
- If the query throws an error, execute some sql that always passes the test case
- Otherwise run the intended test code