refactor composer to use sqlalchemy, avoid string concatenations and follow conventions
This commit is contained in:
@@ -137,6 +137,11 @@ def merge_into_recon(dataset: str, extracted: dict[str, Any]) -> Recon:
|
||||
|
||||
relationships = [Relationship.parse(r) for r in (aug.get("relationships", []) or [])]
|
||||
|
||||
# Storage-encoding overrides (optional). Keyed by Column.semantic_type; each
|
||||
# value maps a role (e.g. "as_date") to a SQL template with a `{col}`
|
||||
# placeholder. The composer merges these over its built-in defaults.
|
||||
encodings: dict[str, dict[str, str]] = aug.get("encodings", {}) or {}
|
||||
|
||||
column_to_tables: dict[str, list[str]] = {}
|
||||
for t in tables.values():
|
||||
for c in t.columns:
|
||||
@@ -150,6 +155,7 @@ def merge_into_recon(dataset: str, extracted: dict[str, Any]) -> Recon:
|
||||
metrics=metrics,
|
||||
column_to_tables=column_to_tables,
|
||||
relationships=relationships,
|
||||
encodings=encodings,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user