Skip to content

[WIP] Fix/rename file#14

Draft
nicolasmerinian wants to merge 2 commits intomainfrom
fix/rename-file
Draft

[WIP] Fix/rename file#14
nicolasmerinian wants to merge 2 commits intomainfrom
fix/rename-file

Conversation

@nicolasmerinian
Copy link
Collaborator

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_temperaturesstg_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
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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') }}.

Suggested change
JOIN `cc-reunion.MENS_meteofrance.stations_zones` sz
JOIN {{ source('MENS_meteofrance', 'stations_zones') }} sz

Copilot uses AI. Check for mistakes.
AVG(NBJRR100) AS Nb_Jours_Sup_100mm

FROM `cc-reunion.data_meteofrance.stg_mensq_pluviometrie`
FROM {{ ref('stg_mensq_pluviometrie') }} t
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
FROM {{ ref('stg_mensq_pluviometrie') }} t
FROM {{ ref('stg_mensq_pluviometrie') }}

Copilot uses AI. Check for mistakes.
@nicolasmerinian nicolasmerinian marked this pull request as draft November 25, 2025 00:09
@nicolasmerinian nicolasmerinian changed the title Fix/rename file [WIP] Fix/rename file Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants