Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Catch .keys() unsupported in python, only required without columns
Browse files Browse the repository at this point in the history
It seems expected that automatic columns would fail without using a
Mapping, but custom columns should work fine without it.

Closes T-913
  • Loading branch information
jacobmischka committed Apr 24, 2023
1 parent 5555897 commit 7118879
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/interval_sdk/components/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 7118879

Please sign in to comment.