Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Project level store_failures overriding test level config with dbt>=1.7 #10165

Closed
2 tasks done
jeremyyeo opened this issue May 16, 2024 · 5 comments
Closed
2 tasks done
Labels
bug Something isn't working stale Issues that have gone stale

Comments

@jeremyyeo
Copy link
Contributor

jeremyyeo commented May 16, 2024

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

With the latest 1.7 version - the project level store_failures config is overriding the model/test level store_failures config.

Expected Behavior

The more specific store_failures config (test/model level) should take precedence over the less specific config (project level) as per config inheritance rules https://docs.getdbt.com/reference/configs-and-properties#config-inheritance like it did with dbt-core <= 1.6

Steps To Reproduce

Project setup

# dbt_project.yml
name: my_dbt_project
profile: all
config-version: 2
version: "1.0.0"

models:
 my_dbt_project:
    +materialized: table

tests:
  +store_failures: true  # all tests

# models/schema.yml
version: 2
models:
  - name: foo
    columns:
      - name: id
        tests:
          - not_null:
              config:
                store_failures: false

-- models/foo.sql
select 1 id

Using dbt 1.7:

$ dbt --debug build

23:40:22  On test.my_dbt_project.not_null_foo_id.f099b1e59c: /* {"app": "dbt", "dbt_version": "1.7.14", "profile_name": "all", "target_name": "dev", "node_id": "test.my_dbt_project.not_null_foo_id.f099b1e59c"} */

        
  
    

  create  table "postgres"."public_dbt_test__audit"."not_null_foo_id"
  
  
    as
  
  (
    
    
    



select *
from "postgres"."public"."foo"
where id is null



  );
  
    
23:40:22  SQL status: SELECT 0 in 0.0 seconds

23:40:22  On test.my_dbt_project.not_null_foo_id.f099b1e59c: /* {"app": "dbt", "dbt_version": "1.7.14", "profile_name": "all", "target_name": "dev", "node_id": "test.my_dbt_project.not_null_foo_id.f099b1e59c"} */
select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
        select *
        from "postgres"."public_dbt_test__audit"."not_null_foo_id"
    
      
    ) dbt_internal_test

Using dbt 1.6

$ dbt --debug build

23:41:15  On test.my_dbt_project.not_null_foo_id.f099b1e59c: /* {"app": "dbt", "dbt_version": "1.6.14", "profile_name": "all", "target_name": "dev", "node_id": "test.my_dbt_project.not_null_foo_id.f099b1e59c"} */
select
      count(*) as failures,
      count(*) != 0 as should_warn,
      count(*) != 0 as should_error
    from (
      
    
    



select id
from "postgres"."public"."foo"
where id is null



      
    ) dbt_internal_test
23:41:15  SQL status: SELECT 1 in 0.0 seconds

Relevant log output

No response

Environment

- OS: macOS
- Python: 3.11
- dbt: 
dbt-core==1.6.14, dbt-postgres==1.6.14
dbt-core==1.7.14, dbt-postgres==1.7.14

Which database adapter are you using with dbt?

postgres

Additional Context

No response

@jeremyyeo jeremyyeo added bug Something isn't working triage labels May 16, 2024
@dbeatty10
Copy link
Contributor

Agreed that the more specific store_failures config (test/model level) should take precedence over the less specific config (project level) as per config inheritance rules. 👍

Thanks for reporting this @jeremyyeo !

@dbeatty10 dbeatty10 removed the triage label May 16, 2024
Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Nov 13, 2024
Copy link
Contributor

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2024
@GtheSheep
Copy link
Contributor

@dbeatty10 - Still seem to be getting this error, though I'm still on dbt 1.8.x, did this get fixed in a later version? Can't seem to find any further references to it, thanks!

@patrick-skydio
Copy link

@dbeatty10 any updates on this? I'm hitting this as well on 1.8.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale Issues that have gone stale
Projects
None yet
Development

No branches or pull requests

4 participants