dbt-datamocktool
dbt-datamocktool copied to clipboard
Help with mocking via macro
im trying to mock data using a macro following the example
{% macro expected_invoices() %}
(
{% set records = [
[1,"aaaaaaaa","type"]
] %}
{% for record in records %}
select {{ record[0] }} as sys_id, '{{ record[1] }}' as id , '{{ record[2] }}' as type
{% if not loop.last %}
union all
{% endif %}
{% endfor %}
) expected_invoices
{% endmacro %}
but am getting the error when running of Macro test_equality expected a Relation but received the value: 14:35:41 ( select 1 as sys_id, 'aaaaaaaa' as id, 'FAC' as type ) as expected_invoices
i have this set up in my .yml
- dbt_datamocktool.unit_test:
input_mapping:
ref('table'): "{{ input_invoices() }}"
expected_output: "{{ expected_invoices() }}"
name: "expecting_type_of"
description: "testing mocking data fro dbt unit testing"
compare_columns:
- sys_id
- id
- type
am i missing something else anywhere ? any help would be much appreciated dbt version 1.3 and im using trino
Sorry for the delay here. Inputs can be macros but expected outputs have to be seed or models right now because the equality test expects a relation.
Let me see if there's a way around that...
@mjirv do you mind if I pick this up? Can look into it