microsoft / dbt-fabric

MIT License
79 stars 28 forks source link

[Bug] +store_failures config in singular tests not working in Fabric #239

Open daviddobos opened 2 weeks ago

daviddobos commented 2 weeks ago

Is this a new bug in dbt-core? I believe this is a new bug in dbt-core I have searched the existing issues, and I could not find an existing issue for this bug Current Behavior The store_failures config is set(false) in a singular test and in the dbt_project.yml at a project lvl(true). This shouldn't work like this according to the config inheritance https://docs.getdbt.com/reference/configs-and-properties

Expected Behavior store_failures should be false for the singular test but its true.

Steps To Reproduce Setup a dbt-fabric project Specify the store_failures config in data_tests(dbt_project.yml) and for the singular test. Set connection with the fabric data warehouse

dbt_project.yml

version: "1.0.0"
config-version: 2

profile: "default"
...
data_tests:
  +store_failures: true

stg_customers.sql

with customers as (

    select * from {{ ref("raw_customers") }}
)

select * from customers

raw_customers.csv

id,first_name,last_name,email
1,Michael,P,michael_p@gmail.com
1,Paris, H, paris_h@gmail.com
2,Shawn,M,shawn_m@yahoo.com
2,Harry,P,harry_p@gmail.com
3,Kathleen,P,kathleen_p@protonmail.com
4,Jimmy,C,jimmy_c@gmail.com
5,Katherine,R,katherine_r@yahoo.com

tst_invalid_id.sql

{{ config(store_failures = false) }}

with invalid as (
select 
* 
from stg_customers
where id is null
)

select * from invalid

Set connection in your profiles.yml file. (something like this)

jaffle_shop: 
  target: dev 
  outputs:
    dev: 
      authentication: CLI 
      database: jaffle-shop-warehouse
      driver: ODBC Driver 18 for SQL Server 
      host: <sql end point to the fabric warehouse>
      schema: <schema name>
      threads: 4 
      type: fabric 

Run dbt test --select tst_invalid_id

It will create an output table in the fabric warehouse.

Environment

- OS: windows 11 pro
- dbt=1.8.1
- fabric=1.8.6