Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR corrects a typo in a SQL model name (from stg_mens_temperatures to stg_mensq_temperatures) and improves dbt lineage by replacing hardcoded table references with the ref() function in intermediate models.
Key changes:
- Fixed model naming typo:
stg_mens_temperatures→stg_mensq_temperatures - Replaced hardcoded table references with
{{ ref() }}function calls in intermediate models - Updated YAML configuration to reflect the corrected model name
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| models/staging/stg_mensq_temperatures.sql | New staging model for monthly temperature data with data quality filters |
| models/staging/_stg_models.yml | Updated model name from stg_mens_temperatures to stg_mensq_temperatures |
| models/intermediate/int_mensq_temperatures_sup_20deg.sql | Replaced hardcoded staging table reference with {{ ref('stg_mensq_temperatures') }} |
| models/intermediate/int_mensq_pluviometrie_sup_100mm.sql | Replaced hardcoded staging table reference with {{ ref('stg_mensq_pluviometrie') }} |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SUM(t.NBJTNS20) AS nuits_ge_20_par_station | ||
| FROM `cc-reunion.data_meteofrance.stg_mens_temperatures` t | ||
| FROM {{ ref('stg_mensq_temperatures') }} t | ||
| JOIN `cc-reunion.MENS_meteofrance.stations_zones` sz |
There was a problem hiding this comment.
The hardcoded table reference should use dbt's {{ source() }} macro instead of a direct table reference. This ensures proper lineage tracking and makes the code more maintainable. Consider defining this as a source in your sources.yml file and referencing it as {{ source('MENS_meteofrance', 'stations_zones') }}.
| JOIN `cc-reunion.MENS_meteofrance.stations_zones` sz | |
| JOIN {{ source('MENS_meteofrance', 'stations_zones') }} sz |
| AVG(NBJRR100) AS Nb_Jours_Sup_100mm | ||
|
|
||
| FROM `cc-reunion.data_meteofrance.stg_mensq_pluviometrie` | ||
| FROM {{ ref('stg_mensq_pluviometrie') }} t |
There was a problem hiding this comment.
The alias t is defined but never used in the query. Either remove the alias or use it to qualify the column references (e.g., t.ANNEE, t.MOIS, etc.) for better readability and to avoid potential ambiguity.
| FROM {{ ref('stg_mensq_pluviometrie') }} t | |
| FROM {{ ref('stg_mensq_pluviometrie') }} |
J'ai corrigé une typo dans un nom de modèle SQL.
J'avais oublié de réutiliser la fonction ref pour le lineage entre les STG et les INT