feat: complete catalog-driven preprocessing
Publish documentation / publish (push) Successful in 2m12s

This commit is contained in:
Codex
2026-09-06 17:49:35 +02:00
parent 8707ae1d46
commit cffa60772e
141 changed files with 5898 additions and 3015 deletions
+18
View File
@@ -118,6 +118,24 @@ def _load_effective_relationships(cfg, physical: PhysicalSchema) -> dict[str, li
def load_schema_context(cfg, *, physical_file: Path | None = None) -> SchemaContext:
if physical_file is None and cfg.paths.catalog_metadata_snapshot is not None:
from tht.mschema.catalog_snapshot import (
CatalogSnapshotError,
load_catalog_metadata_snapshot,
)
try:
snapshot = load_catalog_metadata_snapshot(
cfg.paths.catalog_metadata_snapshot, cfg._workspace_id
)
physical, annotations, relationships = snapshot.to_schema_inputs()
except CatalogSnapshotError as exc:
raise SchemaContextError(str(exc)) from exc
return SchemaContext(
physical=physical,
annotations=annotations,
effective_relationships=relationships,
)
physical_file = physical_file or physical_path(cfg)
if not physical_file.is_file():
raise SchemaContextError(f"physical schema is missing: {physical_file}")