scene_pipelines.ingestion.scene.admin.lab
Admin helper: ensure a Lab catalog row exists.
lab_meta_payload
Non-key Lab fields. Missing names hash as empty strings.
ensure_lab
ensure_lab(lab: DjRow[Lab], *, deployment: DjRow[Deployment] | None = None, if_exists: DuplicatePolicy = REJECT) -> DjKey[Lab]
Insert a lab row and stamp the deployment that registered it.
Runs atomically; joins the caller's transaction when one is open.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lab
|
DjRow[Lab]
|
Full lab insert dict ( |
required |
deployment
|
DjRow[Deployment] | None
|
Optional deployment row. If omitted, built from
|
None
|
if_exists
|
DuplicatePolicy
|
Policy when |
REJECT
|
Returns:
| Type | Description |
|---|---|
DjKey[Lab]
|
Lab primary key |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |