dbt-labs / dbt-project-evaluator

This package contains macros and models to find DAG issues automatically
https://dbt-labs.github.io/dbt-project-evaluator/latest/
Apache License 2.0
447 stars 67 forks source link

Compilation Error in model stg_sources: 'None' has no attribute 'warn_after' #482

Closed shah204 closed 2 months ago

shah204 commented 2 months ago

Describe the bug

I am attempting to install the package and run dbt build --select package:dbt_project_evaluator. When I do this, I get the following error message:

Compilation Error in model stg_sources (models/staging/graph/stg_sources.sql)
  'None' has no attribute 'warn_after'

  > in macro get_resource_values (macros/unpack/get_resource_values.sql)
  > called by macro insert_resources_from_graph (macros/insert_resources_from_graph.sql)
  > called by macro run_hooks (macros/materializations/hooks.sql)
  > called by macro materialization_table_redshift (macros/materializations/table.sql)
  > called by model stg_sources (models/staging/graph/stg_sources.sql)

Steps to reproduce

I am on dbt version 1.8.0, and dbt_project_evaluator version 0.13.0.

Expected results

Run all models.

Actual results

Errors on stg_sources.

Screenshots and log output

System information

The contents of your packages.yml file:

Screenshot 2024-08-20 at 10 34 50 AM

Which database are you using dbt with?

The output of dbt --version:

1.8.0

Additional context

Are you interested in contributing the fix?

b-per commented 2 months ago

Thanks for raising this. I will have a look. It seems quite odd though 😄 . If you go on 0.12.x for the meantime it should still work.

b-per commented 2 months ago

Do you have freshness: null somewhere in the YML of your sources? It seems to be the cause of the issue but I don't see it in the packages that you are installing.

shah204 commented 2 months ago

Hey @b-per, thanks for the quick response. Going to a lower version did resolve this for now 😄

I have the following in my sources.yml for one source schema:

     freshness:
      warn_after: {count: 24, period: hour}
b-per commented 2 months ago

I was able to repro it. I have a PR out and will release a new patch version of the provider when I get approval

b-per commented 2 months ago

0.13.1 should be available on the dbt Hub in the next couple of hours

shah204 commented 2 months ago

Thank you!