Hi all, I’m using dbt datamocktool package to perform unit testing for my dbt models. In datamocktool, I can provide the input data as CSV on which my model will run and generate output and I can also put output data as expected result. dbt will compare both the expected output and the generated result of the model based on the provided input data.
It is working fine for now. But I want to add aggregation on the generated result so that I can put aggregated expected output as CSV files and dbt will compare both. Is there any way I can do it with the datamocktool package or any other way?
Any help is appreciated!!!
This is an example of datamocktool package unit testing where we can define unit testing for any model with input data as csv files and expected_output as csv files too.
version: 2
models:
- name: CUSTOMERS
tests:- dbt_datamocktool.unit_test:
input_mapping:
source(‘sample_data’, ‘CUSTOMER’): ref(‘dmt_raw_customers’) #csv file
expected_output: ref(‘dmt_expected_customers’) # csv file
- dbt_datamocktool.unit_test: