Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_gather_columns agnostic search #991

Merged
merged 24 commits into from
Nov 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
mavaylon1 marked this conversation as resolved.
Show resolved Hide resolved
cls.__columns__ = tuple(new_columns)
except AttributeError:
mavaylon1 marked this conversation as resolved.
Show resolved Hide resolved
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