Skip to content

Null values for properties are computed before checking if new rows need to be added #1629

@h-mayorquin

Description

@h-mayorquin

This issue is related to PR #1624 which exposes the null_values_for_properties parameter as a workaround for the error that occurs when properties lack sensible default values.

However, the underlying problem is that null values are computed preemptively without first checking whether they will actually be needed.

In add_electrodes_to_nwbfile, the code computes null values for all properties that exist in the electrode table but are not being added.

The error in _get_null_value_for_property is raised at this point if a property has a type without a sensible default.

However, these null values are only used later when adding new rows.

If channel_ids_to_add is empty (i.e., no new electrodes need to be added), the null values are never used, but the error would have already been raised.

The same pattern exists in _add_units_table_to_nwbfile.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions