From ae77f8261f35603c66b8ec6165ac6ab0bf0c68a2 Mon Sep 17 00:00:00 2001 From: FBruzzesi Date: Thu, 30 Oct 2025 21:53:01 +0100 Subject: [PATCH] use isinstance(dtype, (...)) --- rio/components/table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rio/components/table.py b/rio/components/table.py index 6c2f0070..cc8c48bf 100644 --- a/rio/components/table.py +++ b/rio/components/table.py @@ -694,9 +694,9 @@ def _data_to_columnar( # If the entire column is a supported type, use it as is. col = nw_data.get_column(col_name) - if dtype.is_numeric() or dtype in {nw.String(), nw.Boolean()}: + if dtype.is_numeric() or isinstance(dtype, (nw.String, nw.Boolean)): columns.append(col.to_list()) - elif dtype in {nw.Date, nw.Datetime}: + elif isinstance(dtype, (nw.Date, nw.Datetime)): columns.append(col.dt.to_string(date_format_string).to_list()) else: columns.append(_convert_iterable(col, date_format_string))