feat: expose effective_root paths in SQL runtime templates#65
Merged
feat: expose effective_root paths in SQL runtime templates#65
Conversation
Contributor
Author
|
@Gabrymi93 pronta per review. Fix additive-only: esposto nel template runtime, backward-compatible con tutti i dataset.yml esistenti. Collega dataset-incubator#69. |
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.
Supports dataciviclab/dataset-incubator#69
Cosa cambia
toolkit/core/template.pybuild_runtime_template_ctx(...)root,root_posix,base_dir,base_dir_posix{year}e{dataset}toolkit/clean/run.pyetoolkit/mart/run.pyeffective_rootreale senza dipendere dal current working directorytoolkit/cli/sql_dry_run.py{root_posix}Test
{root_posix}run_mart(...)con{root_posix}Perché
Nel follow-up
dataset-incubator#69il candidateispra-ru-costi-kgaveva bisogno di leggere parquet MART gia' prodotti sotto l'effective_rootdel dataset.Senza un placeholder runtime per il root, l'unica opzione era hardcodare
out/data/...nei SQL, con due effetti indesiderati:Questo hook resta minimale e backward-compatible, ma sblocca un contratto molto piu' robusto per SQL compose/cross che leggono artifact gia' materializzati.
Verifica
ruff check toolkit/core/template.py toolkit/clean/run.py toolkit/mart/run.py toolkit/cli/sql_dry_run.py tests/test_run_dry_run.py tests/test_artifacts_policy.pypytest tests/test_run_dry_run.py -q -k root_posixpytest tests/test_artifacts_policy.py -q -k root_posixpytest tests/test_cli_path_contract.py tests/test_run_dry_run.py -q