fix: provide helpful error when table heading is not configured#1324
Merged
dimitri-yatsenko merged 2 commits intopre/v2.0from Jan 9, 2026
Merged
fix: provide helpful error when table heading is not configured#1324dimitri-yatsenko merged 2 commits intopre/v2.0from
dimitri-yatsenko merged 2 commits intopre/v2.0from
Conversation
When using tables from non-activated schemas, operations that access
the heading now raise a clear DataJointError instead of confusing
"NoneType has no attribute" errors.
Example:
schema = dj.Schema() # Not activated
@Schema
class MyTable(dj.Manual): ...
MyTable().heading # Now raises: "Table `MyTable` is not properly
# configured. Ensure the schema is activated..."
Closes #1039
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The heading property now returns None for base tier classes (Lookup, Manual, Imported, Computed, Part) instead of raising an error. This allows Python's help() and inspect modules to work correctly. User-defined table classes still get the helpful error message when trying to access heading on a non-activated schema. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Provide helpful error messages when using tables from non-activated schemas.
Problem
When using a table from a non-activated schema, operations produced confusing errors:
Solution
Override the
headingproperty inTableclass to check forNoneand raise a clear error:Before/After
table.headingAttributeError: 'NoneType'...DataJointError: Table X is not properly configured...table.primary_keyAttributeError: 'NoneType'...DataJointError: Table X is not properly configured...Test plan
Closes #1039
🤖 Generated with Claude Code