From 7118879430790e1ace68b1a61845ceb81a5adb36 Mon Sep 17 00:00:00 2001 From: Jacob Mischka Date: Mon, 24 Apr 2023 12:46:34 -0500 Subject: [PATCH] Catch .keys() unsupported in python, only required without columns It seems expected that automatic columns would fail without using a Mapping, but custom columns should work fine without it. Closes T-913 --- src/interval_sdk/components/table.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/interval_sdk/components/table.py b/src/interval_sdk/components/table.py index d8a55a3..47b9821 100644 --- a/src/interval_sdk/components/table.py +++ b/src/interval_sdk/components/table.py @@ -121,9 +121,14 @@ def columns_builder( log_missing_column: Optional[Callable[[str], None]] = None, ) -> list[TableColumnDef]: # using a dict instead of a set because dicts are ordered and sets aren't - data_columns: dict[str, None] = ( - {col: None for row in data for col in row.keys()} if data is not None else {} - ) + try: + data_columns: dict[str, None] = ( + {col: None for row in data for col in row.keys()} + if data is not None + else {} + ) + except: + data_columns = {} if columns: