Skip to content

Commit 0107d8d

Browse files
Fix Table.describe() to show core types instead of native types
When a column is declared with a core type (like uuid, int32, float64), describe() now displays the original core type name instead of the underlying database type (e.g., shows "uuid" instead of "binary(16)"). Uses the Attribute.original_type field which stores the core type alias. Bump version to 2.0.0a2. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ef6c66d commit 0107d8d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/datajoint/table.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,11 @@ def describe(self, context=None, printout=False):
886886
attributes_declared.update(fk_props["attr_map"])
887887
if do_include:
888888
attributes_declared.add(attr.name)
889+
# Use original_type (core type alias) if available, otherwise use type
890+
display_type = attr.original_type or attr.type
889891
definition += "%-20s : %-28s %s\n" % (
890892
(attr.name if attr.default is None else "%s=%s" % (attr.name, attr.default)),
891-
"%s%s" % (attr.type, " auto_increment" if attr.autoincrement else ""),
893+
"%s%s" % (display_type, " auto_increment" if attr.autoincrement else ""),
892894
"# " + attr.comment if attr.comment else "",
893895
)
894896
# add remaining indexes

src/datajoint/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# version bump auto managed by Github Actions:
22
# label_prs.yaml(prep), release.yaml(bump), post_release.yaml(edit)
33
# manually set this version will be eventually overwritten by the above actions
4-
__version__ = "2.0.0a1"
4+
__version__ = "2.0.0a2"

0 commit comments

Comments
 (0)