From a5f33c2433e1f59ebd1478a577dd8ababae6d5c9 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Thu, 4 Apr 2024 03:02:35 -0700 Subject: [PATCH] Don't override col_cls in DynamicTable.add_column --- src/hdmf/common/table.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hdmf/common/table.py b/src/hdmf/common/table.py index 3b67ff19d..1e8c3af7a 100644 --- a/src/hdmf/common/table.py +++ b/src/hdmf/common/table.py @@ -821,11 +821,13 @@ def add_column(self, **kwargs): # noqa: C901 raise ValueError("column '%s' cannot be both a table region " "and come from an enumerable set of elements" % name) if table is not False: - col_cls = DynamicTableRegion + if col_cls is None: + col_cls = DynamicTableRegion if isinstance(table, DynamicTable): ckwargs['table'] = table if enum is not False: - col_cls = EnumData + if col_cls is None: + col_cls = EnumData if isinstance(enum, (list, tuple, np.ndarray, VectorData)): ckwargs['elements'] = enum