Skip to content

Commit

Permalink
_gather_columns agnostic search
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Oct 31, 2023
1 parent 318ccd1 commit 6905781
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/hdmf/common/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,16 @@ def __gather_columns(cls, name, bases, classdict):
msg = "'__columns__' must be of type tuple, found %s" % type(cls.__columns__)
raise TypeError(msg)

if (len(bases) and 'DynamicTable' in globals() and issubclass(bases[-1], Container)
and bases[-1].__columns__ is not cls.__columns__):
new_columns = list(cls.__columns__)
new_columns[0:0] = bases[-1].__columns__ # prepend superclass columns to new_columns
cls.__columns__ = tuple(new_columns)
if len(bases) and 'DynamicTable' in globals():
for item in bases:
if issubclass(item, Container):
try:
if item.__columns__ is not cls.__columns__:
new_columns = list(cls.__columns__)
new_columns[0:0] = bases[-1].__columns__ # prepend superclass columns to new_columns
cls.__columns__ = tuple(new_columns)
except AttributeError:
continue

Check warning on line 290 in src/hdmf/common/table.py

View check run for this annotation

Codecov / codecov/patch

src/hdmf/common/table.py#L289-L290

Added lines #L289 - L290 were not covered by tests

@docval({'name': 'name', 'type': str, 'doc': 'the name of this table'}, # noqa: C901
{'name': 'description', 'type': str, 'doc': 'a description of what is in this table'},
Expand Down

0 comments on commit 6905781

Please sign in to comment.