Fix #775: handle empty datasets in get_type with informative error#1421
Fix #775: handle empty datasets in get_type with informative error#1421sejalpunwatkar wants to merge 5 commits intohdmf-dev:devfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1421 +/- ##
==========================================
- Coverage 92.85% 92.76% -0.09%
==========================================
Files 41 41
Lines 9989 9993 +4
Branches 2054 2056 +2
==========================================
- Hits 9275 9270 -5
- Misses 436 441 +5
- Partials 278 282 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e57ee4e to
3a9b976
Compare
|
Hi @rly , I've updated the PR to fix #775. I added the safety check for empty datasets in get_type and included a corresponding unit test. |
|
The optional and zarr tests are expected to fail until the next pynwb release, so those are OK. The ruff / style changes are significant and should be moved to a separate PR so that this one is easy to review and self-contained. However, I don't think ruff should be complaining about changing single quote to double quote if you are running it from the repo, which should use the configuration specified in Could you please limit this PR to just the changes relevant to the fix? |
3a9b976 to
996d7f4
Compare
for more information, see https://pre-commit.ci
This PR addresses issue #775 where validation of datasets with empty shapes caused an
IndexError.Changes:
get_typeinvalidator.pyto check for empty/null data before indexing.IndexErrorwith a more informativeEmptyArrayError.tests/unit/test_validator.pyto verify the fix and prevent regressions.Fixes #775