Skip to content

feat: supporto ai config compose-only per run mart#63

Merged
Gabrymi93 merged 3 commits intomainfrom
feat/compose-mart-only
Mar 23, 2026
Merged

feat: supporto ai config compose-only per run mart#63
Gabrymi93 merged 3 commits intomainfrom
feat/compose-mart-only

Conversation

@Gabrymi93
Copy link
Copy Markdown
Member

@Gabrymi93 Gabrymi93 commented Mar 21, 2026

Sintesi

  • permette a toolkit run mart --config ... di eseguire config senza clean layer quando il SQL del mart è autosufficiente
  • lascia run all e run clean fuori contratto per i config mart-only / compose-only, con errore leggibile
  • aggiunge test dry-run e test di esecuzione per i config compose-only

Dettagli

  • run_mart() salta il precheck sulla clean dir quando non è configurato clean.sql
  • il dry-run SQL valida i config mart-only senza sintetizzare clean_input
  • la validazione mart tollera l'assenza del blocco mart.validate
  • i flussi esistenti source-dataset con clean + mart mantengono il comportamento attuale

Test

  • py -m pytest tests/test_run_dry_run.py tests/test_artifacts_policy.py tests/test_project_example_e2e.py tests/test_run_validation_gate.py -q

Closes #45

@Gabrymi93 Gabrymi93 changed the title feat: support mart-only compose configs feat: supporto ai config compose-only per run mart Mar 21, 2026
@Gabrymi93 Gabrymi93 force-pushed the feat/compose-mart-only branch from 4776809 to 3530e2b Compare March 22, 2026 11:10
Lore222
Lore222 previously approved these changes Mar 23, 2026
Copy link
Copy Markdown

@Lore222 Lore222 left a comment

Choose a reason for hiding this comment

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

ok

Copy link
Copy Markdown
Contributor

@matteocavo matteocavo left a comment

Choose a reason for hiding this comment

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

Non approverei ancora per 1 finding High.

run_mart() e sql_dry_run oggi non hanno lo stesso contratto sui config mart-only.

Nel branch della PR, toolkit/mart/run.py continua a creare clean_input se trova parquet sotto data/clean/..., anche quando clean.sql non è configurato.

Invece toolkit/cli/sql_dry_run.py crea clean_input solo se cfg.clean.get("sql") è presente.

Questo apre una divergenza concreta tra dry-run e runtime:

  • un SQL compose-only che per errore referenzia clean_input può fallire correttamente in --dry-run
  • ma poi passare a runtime se sul disco esiste una data/clean/... stale
  • nel caso peggiore, il mart legge dati vecchi fuori contratto e produce output apparentemente validi

Per me il fix giusto è semplice:
quando clean.sql non è configurato, run_mart() deve ignorare del tutto data/clean/... e non creare mai clean_input.

Non ho trovato altri finding bloccanti oltre a questo.
Se si chiude questo punto, la PR mi sembra molto vicina ad essere approvabile.

@Gabrymi93
Copy link
Copy Markdown
Member Author

Ho pushato un fix mirato sul branch per chiudere la divergenza tra dry-run e runtime sui config mart-only / compose-only.

Cosa cambia:

  • run_mart() non legge piu data/clean/... quando clean.sql non e configurato
  • quindi un SQL mart-only che referenzia per errore clean_input non puo piu appoggiarsi a clean parquet stale presenti sul disco
  • aggiunto test regressivo sul caso mart-only + stale clean dir
  • riallineati i test diretti di run_mart() al contratto esplicito di clean_cfg

Verifica locale:

  • py -m pytest tests/test_run_dry_run.py tests/test_artifacts_policy.py -q
  • esito: 14 passed

@Gabrymi93 Gabrymi93 enabled auto-merge (squash) March 23, 2026 13:14
Copy link
Copy Markdown
Contributor

@matteocavo matteocavo left a comment

Choose a reason for hiding this comment

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

tutto ok

@Gabrymi93 Gabrymi93 merged commit 22e1a00 into main Mar 23, 2026
5 checks passed
@Gabrymi93 Gabrymi93 deleted the feat/compose-mart-only branch March 23, 2026 13:19
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.

toolkit: supportare compose multi-fonte senza clean propria

3 participants