-
Notifications
You must be signed in to change notification settings - Fork 28
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
Failsafe etelemetry import #1399
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1399 +/- ##
===========================================
- Coverage 88.51% 67.92% -20.59%
===========================================
Files 77 77
Lines 10492 10477 -15
===========================================
- Hits 9287 7117 -2170
- Misses 1205 3360 +2155
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
See #1400 regarding the test failures. |
I don't think that failing test has anything to do with this -- likely change in pynwb or inspector, heh_____________________ test_validate_simple3_no_subject_id ______________________
dandi/tests/test_files.py:364: in test_validate_simple3_no_subject_id
assert errmsgs == ["subject_id is missing."]
E assert ["Traceback (...tartswith'\n"] == ['subject_id is missing.']
E
E At index 0 diff: 'Traceback (most recent call last):\n File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/nwbinspector/nwbinspector.py", line 588, in inspect_nwbfile\n for inspector_message in inspect_nwbfile_object(\n File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/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 "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/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 + '"/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/nwbinspector/nwbinspector.py", '
E + 'line 588, in inspect_nwbfile\n'
E + ' for inspector_message in inspect_nwbfile_object(\n'
E + ' File '
E + '"/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/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 + '"/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/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 ]
---------- coverage: platform linux, python 3.12.1-final-0 -----------
Coverage XML written to file coverage.xml
============================= slowest 10 durations =============================
47.90s setup dandi/cli/tests/test_service_scripts.py::test_reextract_metadata
10.14s call dandi/tests/test_metadata.py::test_bids_nwb_metadata_integration
9.62s call dandi/tests/test_dandiapi.py::test_get_dandiset_published_other_version[False]
9.24s call dandi/tests/test_dandiapi.py::test_publish_and_manipulate
8.90s call dandi/tests/test_dandiapi.py::test_get_dandiset_published_other_version[True]
7.23s call dandi/tests/test_upload.py::test_upload_bids_zarr
6.30s call dandi/tests/test_download.py::test_download_multiple_urls
6.23s call dandi/tests/test_upload.py::test_upload_different_zarr_entry_conflicts
5.74s call dandi/tests/test_download.py::test_download_newest_version
5.73s call dandi/tests/test_upload.py::test_upload_different_zarr_file_to_parent_dir
=========================== short test summary info ============================
FAILED dandi/tests/test_files.py::test_validate_simple3_no_subject_id - assert ["Traceback (...tartswith'\n"] == ['subject_id is missing.']
At index 0 diff: 'Traceback (most recent call last):\n File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/nwbinspector/nwbinspector.py", line 588, in inspect_nwbfile\n for inspector_message in inspect_nwbfile_object(\n File "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/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 "/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/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.'
Full diff:
[
- 'subject_id is missing.',
+ 'Traceback (most recent call last):\n'
+ ' File '
+ '"/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/nwbinspector/nwbinspector.py", '
+ 'line 588, in inspect_nwbfile\n'
+ ' for inspector_message in inspect_nwbfile_object(\n'
+ ' File '
+ '"/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/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 '
+ '"/opt/hostedtoolcache/Python/3.12.1/x64/lib/python3.12/site-packages/nwbinspector/nwbinspector.py", '
+ 'line 632, in _intercept_in_vitro_protein\n'
+ ' and getattr(subject, "subject_id", "").startswith("protein")\n'
+ ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n'
+ "AttributeError: 'NoneType' object has no attribute 'startswith'\n",
]
======= 1 failed, 707 passed, 1 skipped, 2 xfailed in 733.71s (0:12:13) ======== thank you -- makes sense, let's proceed |
🚀 PR was released in |
Currently DANDI will fail to work due to this import specifically if etelemetry is not present.
All other code points where etelemetry is needed are either caught exceptions or controlled by
NO_ET
.Let me know if I should do this differently.