You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been diving into the new unit-testing framework recently introduced by dbt labs, and I'm quite impressed by its capabilities. However, I've encountered a couple of challenges that I'm hoping to address.
Firstly, it seems that when creating multiple tests, I end up having to redefine the table/ref's data each time. This leads to some code duplication, which isn't ideal. In my previous experience with Python, I've relied on Python Factory Boy to generate customized data based on initial datasets. This approach effectively merges existing data with new data required for testing, helping to avoid such redundancies in the code.
Secondly, I'm exploring how to test an Airflow DAG where one model runs after another, with the second model relying on the output of the first. Specifically, I'm interested in setting up a test scenario where the input mirrors that of the first model, and the expected output aligns with the output of the second model. This approach aims to conduct comprehensive integration testing to observe and validate the interaction between these interconnected models.
I'm curious to know how the dbt unit-testing framework addresses these issues, but I couldn't find any documentation specifically addressing them. Any insights would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello there,
I've been diving into the new unit-testing framework recently introduced by dbt labs, and I'm quite impressed by its capabilities. However, I've encountered a couple of challenges that I'm hoping to address.
Firstly, it seems that when creating multiple tests, I end up having to redefine the table/ref's data each time. This leads to some code duplication, which isn't ideal. In my previous experience with Python, I've relied on Python Factory Boy to generate customized data based on initial datasets. This approach effectively merges existing data with new data required for testing, helping to avoid such redundancies in the code.
Secondly, I'm exploring how to test an Airflow DAG where one model runs after another, with the second model relying on the output of the first. Specifically, I'm interested in setting up a test scenario where the input mirrors that of the first model, and the expected output aligns with the output of the second model. This approach aims to conduct comprehensive integration testing to observe and validate the interaction between these interconnected models.
I'm curious to know how the dbt unit-testing framework addresses these issues, but I couldn't find any documentation specifically addressing them. Any insights would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions