Closed AlejandroAlmaraz closed 6 months ago
It happens the same to me with this unit test below:
{{ config(tags=['unit-test']) }}
{% set options = {} %}
{% call dbt_unit_testing.test(
'funds', 'should contain only funds its company belong to a structure investment vehicle') %}
{# *********************** Arrange *********************** #}
{% call dbt_unit_testing.mock_ref('stg_backend__funds') %}
uuid | company_id
'OK' | 1
'KO' | 2
{% endcall %}
{% call dbt_unit_testing.mock_ref('stg_backend__companies') %}
id
1
2
{% endcall %}
{% call dbt_unit_testing.mock_ref('stg_backend__structure_investment_vehicles') %}
vehicle_id
1
{% endcall %}
{% call dbt_unit_testing.expect(options) %}
uuid
'OK'
{% endcall %}
{% endcall %}
Hello! We had this issue and we think it was a conflict with dbt_artifacts. It looks like part of logging models deletes the raw_code
attribute from the each model. During dbt compile it seems like the unit test module does something after the on-run-end hook. That was where we saw the error. Perhaps your issues are connected if you use that package?
Hi @AlejandroAlmaraz , @victormartingarcia
could you please confirm that you are using dbt_artifacts
package?
Thank you!
Fix for this was just accepted, so should be in the next release of dbt_artifacts.
Closing due to inactivity. thank you!
Dataplatform: Snowflake Package unit-testing version: 0.3.3 DBT version: 1.5.1
I created a example test in my project and I am getting the following error when dbt compile run against all the project.
I do not have any problem when I run dbt test, I saw after some debuging this raw_code is present when dbt test is executed but using dbt compile is not present in the model_node variable.
Code test: