dandi / dandi-cli

DANDI command line client to facilitate common operations
https://dandi.readthedocs.io/
Apache License 2.0
22 stars 27 forks source link

`test_validate_simple3_no_subject_id` failing #1400

Closed jwodder closed 9 months ago

jwodder commented 9 months ago

The test dandi/tests/test_files.py::test_validate_simple3_no_subject_id is currently failing with the error:

dandi/tests/test_files.py:364: in test_validate_simple3_no_subject_id
    assert errmsgs == ["subject_id is missing."]
E   assert ['Traceback (most recent call last):\n  File "/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", line 588, in inspect_nwbfile\n    for inspector_message in inspect_nwbfile_object(\n  File "/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", line 686, in inspect_nwbfile_object\n    subject_dependent_checks = _intercept_in_vitro_protein(nwbfile_object=nwbfile_object, checks=checks)\n                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", line 632, in _intercept_in_vitro_protein\n    and getattr(subject, "subject_id", "").startswith("protein")\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: \'NoneType\' object has no attribute \'startswith\'\n'] == ['subject_id is missing.']
E     
E     At index 0 diff: 'Traceback (most recent call last):\n  File "/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", line 588, in inspect_nwbfile\n    for inspector_message in inspect_nwbfile_object(\n  File "/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", line 686, in inspect_nwbfile_object\n    subject_dependent_checks = _intercept_in_vitro_protein(nwbfile_object=nwbfile_object, checks=checks)\n                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", line 632, in _intercept_in_vitro_protein\n    and getattr(subject, "subject_id", "").startswith("protein")\n        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: \'NoneType\' object has no attribute \'startswith\'\n' != 'subject_id is missing.'
E     
E     Full diff:
E       [
E     -     'subject_id is missing.',
E     +     'Traceback (most recent call last):\n'
E     +     '  File '
E     +     '"/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", '
E     +     'line 588, in inspect_nwbfile\n'
E     +     '    for inspector_message in inspect_nwbfile_object(\n'
E     +     '  File '
E     +     '"/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", '
E     +     'line 686, in inspect_nwbfile_object\n'
E     +     '    subject_dependent_checks = '
E     +     '_intercept_in_vitro_protein(nwbfile_object=nwbfile_object, '
E     +     'checks=checks)\n'
E     +     '                               '
E     +     '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
E     +     '  File '
E     +     '"/Users/jwodder/dartmouth/dandi-cli/.tox/py3/lib/python3.11/site-packages/nwbinspector/nwbinspector.py", '
E     +     'line 632, in _intercept_in_vitro_protein\n'
E     +     '    and getattr(subject, "subject_id", "").startswith("protein")\n'
E     +     '        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
E     +     "AttributeError: 'NoneType' object has no attribute 'startswith'\n",
E       ]

This seems to be due to the release of nwbinspector 0.4.32 about an hour ago. The test in question involves an NWB that does not have subject_id set.

@bendichter Is this a bug in nwbinspector, or is the test doing something wrong?

yarikoptic commented 9 months ago

submitting PR to fix it https://github.com/NeurodataWithoutBorders/nwbinspector/pull/433

yarikoptic commented 9 months ago

meanwhile we should "fix" by blacklisting current version of nwbinspector, will send a PR

github-actions[bot] commented 9 months ago

:rocket: Issue was released in 0.59.1 :rocket:

github-actions[bot] commented 9 months ago

:rocket: Issue was released in 0.59.1 :rocket: