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:
@@ -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}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user