Skip to content
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

BF: do or to "" to ensure that we do not end up treating None as str #433

Merged

Conversation

yarikoptic
Copy link
Contributor

We started to get a test in dandi-cli to error out

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",

I didn't test yet but this I think should fix it

We started to get a test in dandi-cli to error out

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",

I didn't test yet but this I think should fix it
yarikoptic added a commit to dandi/dandi-cli that referenced this pull request Feb 2, 2024
@CodyCBakerPhD CodyCBakerPhD self-requested a review February 2, 2024 20:42
@CodyCBakerPhD
Copy link
Contributor

@yarikoptic I saw the DANDI alerts, but you beat me to the fix

Added changelog and test

@CodyCBakerPhD
Copy link
Contributor

I will note that we test all PRs against DANDI dev to avoid these kinds of events: https://github.com/NeurodataWithoutBorders/nwbinspector/blob/dev/.github/workflows/dandi-dev.yml

@yarikoptic @jwodder Any idea why it was passing with flying colors on the original PR? #431 (actions run: https://github.com/NeurodataWithoutBorders/nwbinspector/actions/runs/7760160049/job/21165767343)

@CodyCBakerPhD CodyCBakerPhD enabled auto-merge (squash) February 2, 2024 20:46
@jwodder
Copy link
Contributor

jwodder commented Feb 2, 2024

@CodyCBakerPhD You're running dandi's tests through tox, which builds a fresh virtualenv and installs packages from PyPI, ignoring whatever dev version of nwbinspector you've installed outside of tox. Instead of using tox, invoke pytest directly.

@CodyCBakerPhD CodyCBakerPhD merged commit 953198c into NeurodataWithoutBorders:dev Feb 2, 2024
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants