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

Aliasing table reference in cost_per_query and hourly_spend models #133

Closed saurasingh closed 12 months ago

saurasingh commented 1 year ago

@NiallRees For the two models in the subject, we need to alias tables like daily_rates, 'stg_usage_in_currency_daily', stg_metering_history, stg_serverless_task_history, and stg_metering_daily_history. As the dbt CI adds the schema name as the prefix to the table name. Referencing columns from these tables breaks the object definition as they defer in the names, having an alias name should fix this.

Please refer to the screenshots:

Screenshot 2023-10-25 at 4 23 41 PM Screenshot 2023-10-25 at 4 24 12 PM

Tried creating PR to fix this by myself but was not able to commit changes.

ernestoongaro commented 1 year ago

Looks like my PR here would fix this as well

saurasingh commented 12 months ago

Thanks for working on it @ernestoongaro. Do you have a steps on how did you contribute to the repo? I was strugling to setup in locally.

NiallRees commented 12 months ago

Think this is now resolved! Let me know if 4.6.0 doesn't fix this for you @saurasingh