Fix: include partition fields in TableConfig for catalog enrichment

Pass partition_by, partition_granularity, partition_column_type, and
incremental_window_days from YAML to TableConfig to avoid validation errors
when sync_strategy='partitioned'
This commit is contained in:
Petr 2026-03-12 14:29:05 +01:00
parent 2d03a9b557
commit de66f6dd55

View file

@ -396,7 +396,7 @@ def _load_catalog_data() -> list:
# Enrich with catalog metadata (OpenMetadata)
if _catalog_enricher:
try:
# Create minimal config for enrichment
# Create config for enrichment with all available fields
from src.config import TableConfig
table_config = TableConfig(
id=table_id,
@ -404,6 +404,11 @@ def _load_catalog_data() -> list:
description=table.get("description", ""),
primary_key=table.get("primary_key", "id"),
sync_strategy=table.get("sync_strategy", "full_refresh"),
incremental_window_days=table.get("incremental_window_days"),
partition_by=table.get("partition_by"),
partition_granularity=table.get("partition_granularity"),
max_history_days=table.get("max_history_days"),
partition_column_type=table.get("partition_column_type", "TIMESTAMP"),
catalog_fqn=table.get("catalog_fqn"),
)
catalog_data = _catalog_enricher.enrich_table(table_config)
@ -715,6 +720,11 @@ def register_routes(app: Flask) -> None:
description=table_def.get("description", ""),
primary_key=table_def.get("primary_key", "id"),
sync_strategy=table_def.get("sync_strategy", "full_refresh"),
incremental_window_days=table_def.get("incremental_window_days"),
partition_by=table_def.get("partition_by"),
partition_granularity=table_def.get("partition_granularity"),
max_history_days=table_def.get("max_history_days"),
partition_column_type=table_def.get("partition_column_type", "TIMESTAMP"),
catalog_fqn=table_def.get("catalog_fqn"),
)
catalog_data = _catalog_enricher.enrich_table(table_config)