get-select / dbt-snowflake-monitoring

A dbt package from SELECT to help you monitor Snowflake performance and costs
https://select.dev/docs/dbt-snowflake-monitoring
MIT License
219 stars 40 forks source link

Overwriting the source macro #146

Closed gperronegofundme closed 9 months ago

gperronegofundme commented 9 months ago

Hey there! Testing out this package, and am unable to successfully build the dbt_snowflake_monitoring_models due to the way I have implemented the source macro in my project. Essentially, long ago when we set up our dbt project, we overrode the source macro to by default reference a raw database (because it is possible some of our other sources are in other databases) and now it seems that this package is using this same logic when sources are established in the package. So, instead of querying from the snowflake database, it is querying from the raw database for those snowflake specific tables. Any recommendations on how to deal with this without necessarily having to modify our source macro?

EDIT: added this to my source macro

{%if source_name in ['snowflake_account_usage', 'snowflake_organization_usage'] %}
    {% set database = "snowflake" %}
  {%endif%}