From a667b4e32f9cb9d85e40a7f1c95f69e91187b84a Mon Sep 17 00:00:00 2001 From: Petr Date: Wed, 25 Mar 2026 14:47:00 +0100 Subject: [PATCH] Fix profiler crash for remote-only tables without primary_key Same issue as config.py - profiler's TableInfo and parser required primary_key and sync_strategy, breaking auto-profile after sync when daily_deal_traffic (remote-only) is in config. --- src/profiler.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/profiler.py b/src/profiler.py index 0228b9f..66777eb 100644 --- a/src/profiler.py +++ b/src/profiler.py @@ -173,8 +173,8 @@ class TableInfo: table_id: str, name: str, description: str, - primary_key: str, - sync_strategy: str, + primary_key: str = "", + sync_strategy: str = "none", foreign_keys: Optional[List[ForeignKeyInfo]] = None, partition_by: Optional[str] = None, partition_granularity: Optional[str] = None, @@ -189,6 +189,8 @@ class TableInfo: self.partition_granularity = partition_granularity def get_primary_key_columns(self) -> List[str]: + if not self.primary_key: + return [] return [col.strip() for col in self.primary_key.split(",")] def is_partitioned(self) -> bool: @@ -314,8 +316,8 @@ def parse_data_description(path: Path) -> Tuple[List[TableInfo], Dict[str, str]] table_id=td["id"], name=td["name"], description=td["description"], - primary_key=td["primary_key"], - sync_strategy=td["sync_strategy"], + primary_key=td.get("primary_key", ""), + sync_strategy=td.get("sync_strategy", "none"), foreign_keys=fk_list, partition_by=td.get("partition_by"), partition_granularity=td.get("partition_granularity"),