You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was allowed to create a types.hdmf_common.DynamicTable where one of the columns that were stated in colnames was not declared. An error was thrown only when trying to view the rows. I was expecting that creating the table would fail with an error.
Steps to Reproduce
col1 =types.hdmf_common.VectorData( ...
'description', 'column #1', ...
'data', [1;2;3] ...
);
my_table =types.hdmf_common.DynamicTable( ...
'description', 'an_example table', ...
'colnames', {'col1', 'col2'}, ...
'col1', col1, ...
'id', types.hdmf_common.ElementIdentifiers('data', [0;1;2]) ...
);
% The above works but then the statement below fails.% my_table.getRow(1)
I think that this does not fail because there are scenarios where you might want to declare a set of columns for a table and then gradually fill in column data as data becomes available.
The following statement would work: my_table.getRow(1, 'columns', {'col1'})
One thing that could be done is to generate a more specific error message when running my_table.getRow(1), for example:
There is no row data for the column named 'col2'
instead of The specified key is not present in this container.
where the data is not added in the constructor. However, I do think it would be strange to add some columns in the constructor but not others. How would you add the other columns later? Is that possible right now?
What happened?
I was allowed to create a
types.hdmf_common.DynamicTable
where one of the columns that were stated in colnames was not declared. An error was thrown only when trying to view the rows. I was expecting that creating the table would fail with an error.Steps to Reproduce
Error Message
No response
Operating System
Windows
Matlab Version
Code of Conduct
The text was updated successfully, but these errors were encountered: