Repository navigation
fix(registry): mart per-anno su dataset multi-anno pubblicati con glob - #519
Merged
Merged
Conversation
I mart per-anno sono un file per anno ({slug}/{year}/{table}.parquet), ma il
builder pubblicava una location puntuale all'anno massimo con multi_file=false:
i consumer del registry (dcl-mcp gcs_query) vedevano un solo anno invece della
serie storica. Il clean non aveva il problema: clean_location globa quando
len(years) > 1.
- paths.py: mart_location accetta years e, su più anni, produce il glob
{slug}/*/{table}.parquet con multi_file=true (speculare a clean_location)
- builders.py: passa years a mart_location
- schema: documenta il significato di location.multi_file
- test: contratto multi-anno aggiornato + caso mono-anno invariato
Closes #518
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.
Sintesi
Il registry pubblicava i mart per-anno su dataset multi-anno con un path puntuale all'anno massimo e
multi_file: false:I file mart sono uno per anno (
{slug}/{year}/{table}.parquet), quindi i consumer che leggonolocation.pathdal registry — in particolaredcl-mcp(gcs_query) — vedevano un solo anno invece della serie storica. Il clean non aveva il problema:clean_locationgloba conlen(years) > 1.Closes #518
Contesto collegato
Closes #518
Cosa cambia
Bug fix
Nuova funzionalità del motore
Nuovo plugin sorgente
Modifica contratto pubblico (dataset.yml, path output, schema parquet)
Refactor / performance
Documentazione
Dipendenze o CI
registry/paths.py:mart_locationaccettayearse, su più anni, produce il glob{slug}/*/{table}.parquetconmulti_file: true(speculare aclean_location).registry/builders.py: passayears=sorted(manifest.years)amart_location.registry/schemas/registry.schema.json: documenta il significato dilocation.multi_file.Test: contratto multi-anno aggiornato + caso mono-anno (path puntuale invariato).
Impatto su contratti pubblici
dataset.yml(nuovo campo, cambio obbligatorietà)Cambia il valore di
marts[].locationinregistry/registry.jsonper i mart per-anno su dataset multi-anno: da path puntuale (.../{max_year}/{table}.parquet) a glob (.../*/{table}.parquet) conmulti_file: true. Nessun campo nuovo, nessun rename; il campomulti_fileesisteva già (defaulttrueinlab_connectors.registry.models).Verifica
pytest -m corepassa (intera suite verde)ruff check .passamypy toolkit/passacontract)Verifica end-to-end (registry energia-italia, dry-run + lettura del glob da GCS):
Regressione:
test_multi_year_mart_flatetest_path_contract_year_layoutfalliscono senza il fix e passano con il fix.Checklist PR
Note per chi revisiona
{slug}/*/{table}.parquetè robusto anche se un mart non esiste per tutti gli anni dichiarati: DuckDB legge i file presenti.