feat: aggiungi supporto esplicito a output cross_year#23
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Obiettivo
Aggiungere nel toolkit un supporto esplicito e opzionale per output multi-anno (
cross_year), mantenendoraw,cleanemartyear-scoped.Cosa cambia
Questa PR introduce:
cross_yeartoolkit run cross_year --config dataset.ymlroot/data/cross/<dataset>/cleanmart(consource_tableesplicito)Shape supportata
Oppure, se la sorgente è
mart:Scelte di design della v1
cross_yearè esplicito, non automaticorun allclean_inputcleanclean_all_yearsmartPerché
Nel toolkit attuale,
raw,cleanemartgirano per singolo anno.Questo è corretto per la pipeline base, ma non copre bene casi reali in cui il primo output analitico utile è cross-year. Il caso che ha guidato la feature è:
IRPEF comunale 2019-2023File principali
toolkit/core/config_models.pytoolkit/core/config.pytoolkit/cli/cmd_run.pytoolkit/core/paths.pytoolkit/core/metadata.pytoolkit/cross/run.pydocs/config-schema.mdtests/test_cross_year.pyCommit inclusi
4847862feat: aggiungi supporto cross_year esplicito6cc94bedocs: documenta il layer cross_yeare0bab62fix: aggiungi alias *_all_years nel runner cross_yearTest
Test automatici passati:
python -m pytest tests/test_cross_year.pypython -m pytest tests/test_config.py -k "resolves_relative_paths_from_dataset_dir"Test reale
Validato sul caso reale:
dataciviclab/preanalysis/irpef-comunale-2019-2023Comandi eseguiti:
Output prodotto:
dataciviclab/_out/data/cross/irpef_comunale_2019_2023/irpef_capacita_fiscale_multi_anno.parquetVerifiche rapide:
39511righecomune110righeregione2019-2023Note
La feature resta volutamente stretta:
yearscross_yearL’obiettivo qui è introdurre un contract nativo minimo ma già usabile su un caso reale.