Skip to content

fix: preserve year templates in local raw paths#18

Merged
Gabrymi93 merged 1 commit intomainfrom
fix/raw-local-file-year-template
Mar 4, 2026
Merged

fix: preserve year templates in local raw paths#18
Gabrymi93 merged 1 commit intomainfrom
fix/raw-local-file-year-template

Conversation

@Gabrymi93
Copy link
Copy Markdown
Member

Sintesi

Closes #17

Questa PR corregge un bug nel caricamento config: i path RAW local_file con {year} venivano normalizzati troppo presto e il placeholder non arrivava fino a run raw.

Problema

Prima del fix:

  • raw.sources[].args.path con {year} veniva convertito in Path
  • _format_args() in run_raw() applicava la sostituzione solo alle stringhe
  • il placeholder restava letterale
  • local_file falliva su path tipo demo_{year}.csv

Cosa cambia

Durante la normalizzazione config:

  • i path RAW con {year} restano stringhe
  • vengono comunque risolti rispetto alla directory del dataset.yml
  • il template {year} resta disponibile fino al run

Scope

Dentro il perimetro:

  • fix dei path templated per raw.sources[].args.path
  • copertura test dedicata

Fuori scope:

  • cambi al comportamento di CLEAN o MART
  • nuove feature di templating oltre {year}

Test

Eseguiti:

py -m pytest tests/test_config.py tests/test_smoke_tiny_e2e.py -q

Esito:

  • 54 passed

Verifica reale

Usato su due dataset multi-anno locali:

  1. RU Comunali 2018-2024

    • run raw corretto su tutti gli anni
    • inspect schema-diff mostra schema stabile
  2. IRPEF comunale 2018-2023

    • run raw corretto su tutti gli anni
    • inspect schema-diff rileva drift reale:
      • 2020 -> 2021
        • Bonus spettante -> Trattamento spettante
      • 2022 -> 2023
        • aggiunte le colonne Reddito complessivo - Frequenza
        • aggiunte le colonne Reddito complessivo - Ammontare in euro

Nota

Il fix trova il suo posto nel workflow per dataset storici e multi-anno:

dataset.yml -> run raw -> inspect schema-diff -> clean

@Gabrymi93 Gabrymi93 merged commit bf20295 into main Mar 4, 2026
5 checks passed
@Gabrymi93 Gabrymi93 deleted the fix/raw-local-file-year-template branch March 4, 2026 19:05
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.

local_file RAW non supporta correttamente raw.sources[].args.path con {year}

1 participant