You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While running a transformation function named remove_doi_slots from within a Python notebook that imports the containing Python class from the nmdc-schema Python package on PyPI, Python raised an AttributeError exception because a value of None doesn't have an attribute named get.
As a short-term workaround, in the notebook, I ignored the return values after confirming (by reviewing their source code) all the transformation functions modify the dictionary "in place."
I created the following PR which contains a long-term fix: #1312
Summary
While running a transformation function named
remove_doi_slots
from within a Python notebook thatimport
s the containing Python class from thenmdc-schema
Python package on PyPI, Python raised anAttributeError
exception because a value ofNone
doesn't have an attribute namedget
.Screenshot
Related snippets
This is where the exception was raised:
nmdc-schema/nmdc_schema/migration_recursion.py
Lines 382 to 384 in 918056b
These two transformation functions don't return the transformed dictionary (i.e. they implicitly return
None
since they don't havereturn
statements):nmdc-schema/nmdc_schema/migration_recursion.py
Lines 316 to 327 in 918056b
nmdc-schema/nmdc_schema/migration_recursion.py
Lines 368 to 376 in 918056b
As a result, transformation functions "further down the pipeline" won't receive a dictionary as input.
Proposal
End each transformation function with:
The text was updated successfully, but these errors were encountered: