Estimates stored as batches of risks in the domain's database: models store and run --store; a kit file is read as dbt's only when its producer is dbt

This commit is contained in:
2026-11-06 00:21:53 -06:00
parent 22d1fda0f3
commit 761b5b03bc
9 changed files with 236 additions and 15 deletions
+4 -3
View File
@@ -48,9 +48,10 @@ def model_sha(model_dir: str | Path) -> str:
def cohort_reference(metadata: dict[str, str], file_sha256: str) -> dict[str, str]:
"""How a run, a version or an estimate points to the cohort build file it used: its cohort, who built it (`kit` or
`dbt`), its number in that source and the file's hash. A kit build's number is its `armado_id`."""
source = metadata.get("producer", "kit")
build = metadata["armado_id"] if source == "kit" else metadata["build"]
`dbt`), its number in that source and the file's hash. Only a file whose producer is `dbt` is dbt's; any other is a kit
build, numbered by its `armado_id`."""
source = "dbt" if metadata.get("producer") == "dbt" else "kit"
build = metadata["build"] if source == "dbt" else metadata["armado_id"]
return {COHORT_URL_TAG: metadata["url"], COHORT_SOURCE_TAG: source, COHORT_BUILD_TAG: str(build),
COHORT_FILE_TAG: file_sha256}