Remove unsigned integer types from core types#1335
Merged
dimitri-yatsenko merged 4 commits intopre/v2.0from Jan 17, 2026
Merged
Remove unsigned integer types from core types#1335dimitri-yatsenko merged 4 commits intopre/v2.0from
dimitri-yatsenko merged 4 commits intopre/v2.0from
Conversation
Remove uint8, uint16, uint32, and uint64 from CORE_TYPES dictionary. These unsigned integer types are MySQL-specific and not portable to PostgreSQL and other database backends. Unsigned types can still be used as native types (with existing warning system for non-core types), but are no longer recommended as part of DataJoint's portable core type system. This establishes a clean foundation for multi-database support in v2.1. Part of v2.0 core type system revision.
Replace all uses of uint8, uint16, uint32, uint64 with their signed counterparts in test schemas, following the removal of unsigned types from core types. Changes: - uint8 → int16 (larger signed type for unsigned 8-bit range) - uint16 → int32 (larger signed type for unsigned 16-bit range) - uint32 → int64 (larger signed type for unsigned 32-bit range) - int unsigned → int64 (native type replacement) Updated files: - tests/schema_simple.py: E.M.id_m - tests/schema_type_aliases.py: Remove unsigned types from test table - tests/schema.py: Auto.id, Ephys.Channel.channel - tests/schema_university.py: Student.student_id, Course.course - tests/integration/test_type_aliases.py: Remove unsigned type tests - tests/integration/test_hidden_job_metadata.py: All uint8 → int16 Note: test_blob.py and test_blob_matlab.py unchanged (testing numpy dtypes in serialization, not DataJoint table definitions). Part of v2.0 core type system revision.
- priority: uint8 → int8 - pid: uint32 → int32 - connection_id: uint64 → int64 Ensures job queue uses only core signed integer types.
- Tests that 'int unsigned', 'bigint unsigned', etc. are allowed - Documents that these are MySQL-specific, not portable - Users should prefer signed core types for compatibility Also bump version to 2.0.0a22
dimitri-yatsenko
added a commit
to datajoint/dj-zarr-codecs
that referenced
this pull request
Jan 17, 2026
Update example table definitions to use int32 instead of uint16 to align with DataJoint 2.0.0a22 which removed unsigned integer types from core types. Changes: - Recording.recording_id: uint16 → int32 - MyTable.id: uint16 → int32 Related: datajoint/datajoint-python#1335
dimitri-yatsenko
added a commit
to datajoint/dj-photon-codecs
that referenced
this pull request
Jan 17, 2026
Update example table definitions to use int32 instead of uint16 to align with DataJoint 2.0.0a22 which removed unsigned integer types from core types. Changes: - Recording.recording_id: uint16 → int32 Related: datajoint/datajoint-python#1335
7 tasks
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
Remove unsigned integer types (
uint8,uint16,uint32,uint64) from DataJoint's core type system for v2.0. These types are MySQL-specific and not portable to PostgreSQL and other database backends.Motivation
DataJoint 2.0 is in pre-release and aims to support multiple database backends (PostgreSQL support coming in v2.1). Unsigned integer types only exist in MySQL, creating portability issues:
INTEGER)Since v2.0 already requires migration from 0.14.6, this is the ideal time to establish a clean, portable core type system.
Changes
Implementation (
src/datajoint/declare.py)uint8,uint16,uint32,uint64fromCORE_TYPESdictionaryTests (6 files updated)
Replaced all unsigned core types with signed equivalents:
uint8→int16(larger signed type for unsigned 8-bit range)uint16→int32(larger signed type for unsigned 16-bit range)uint32→int64(larger signed type for unsigned 32-bit range)Files:
tests/schema_simple.py- E.M.id_mtests/schema_type_aliases.py- Removed unsigned types from test tabletests/schema.py- Auto.id, Ephys.Channel.channeltests/schema_university.py- Student.student_id, Course.coursetests/integration/test_type_aliases.py- Removed unsigned type test casestests/integration/test_hidden_job_metadata.py- All uint8 → int16Note:
test_blob.pyandtest_blob_matlab.pyunchanged (testing numpy dtypes in serialization, not DataJoint table definitions).Migration Path
OLD (0.14.6, no longer works in 2.0):
NEW (2.0, portable):
Alternative (MySQL-only, not portable):
Core Types After This Change
Signed integers only:
int8→TINYINTint16→SMALLINTint32→INTint64→BIGINTUnsigned removed:
❌ REMOVEDuint8❌ REMOVEDuint16❌ REMOVEDuint32❌ REMOVEDuint64Users who need unsigned integers must use native MySQL types like
tinyint unsigned,int unsigned, etc., which will trigger warnings about non-portable types.Impact
Who is affected:
uint8,uint16,uint32,uint64core typesMigration:
mouse_id : uint32→mouse_id : int64Why this is acceptable:
Related
pre/v2.1)PROPOSAL_CORE_TYPES_REVISION.mdfor full rationaleTesting