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
Calling class methods, properties, or instance methods derived from parent classes of UserTable creates inconsistent and confusing error messages when schema is not activated for a set of tables.
importdatajointasdjdj.config["loglevel"] ="INFO"schema=dj.Schema()
@schemaclassTableA(dj.Manual):
definition=""" # TableA example table_a : UUID --- label : VARCHAR(100) """# printing of some properties is ok:print(TableA.definition) # ok -> No error.# # TableA example# table_a : UUID# ---# label : VARCHAR(100)# Error description is valid for these cases:TableA().describe() # ok -> DataJointError: Class TableA is not properly declared (schema decorator not applied?)TableA.describe() # ok -> DataJointError: Class TableA is not properly declared (schema decorator not applied?)# Uninformative error:TableA() # bad -> AttributeError: 'NoneType' object has no attribute 'non_blobs'# Additional situations of inconsistent errors when printing from an non-activated `Table`.@schemaclassTableB(dj.Manual):
definition=""" thing : INT ---- label : VARCHAR(200) """instance=TableB()
# ok -> no errorprint(TableB.definition)
# thing : INT# ---# label : VARCHAR(200)# preview.py:51, AttributeError: 'NoneType' object has no attribute 'non_blobs'instance# condition.py:154, AttributeError: 'NoneType' object has no attribute 'names'instance& {}
# expression.py:96, AttributeError: 'NoneType' object has no attribute 'primary_key'instance.fetch("KEY")
# expression.py:96, AttributeError: 'NoneType' object has no attribute 'primary_key'instance.head()
TableB.head()
# condition.py:75, AttributeError: 'NoneType' object has no attribute 'secondary_attributes'TableB&TableA# issues with `__repr__`` and `_repr_html_`# preview.py:8, AttributeError: 'NoneType' object has no attribute 'non_blobs'instance.headTableB.headdj.config["loglevel"] ="DEBUG"# ok -> <bound method QueryExpression.head of <__main__.TableB object at 0x1231b3cd0>>instance.head# diff error than before (closer to indication about activation) -> # expression.py:96, AttributeError: 'NoneType' object has no attribute 'primary_key'instance.head()
The text was updated successfully, but these errors were encountered:
Bug Report
Description
Calling class methods, properties, or instance methods derived from parent classes of
UserTable
creates inconsistent and confusing error messages when schema is not activated for a set of tables.The text was updated successfully, but these errors were encountered: