From 24c329cd43bf5e7acdb50c93499b7bf8b828010b Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Tue, 3 Feb 2026 09:28:41 -0600 Subject: [PATCH 1/4] deprecate: Add deprecation warning to migrate module The datajoint.migrate module will be removed in DataJoint 2.2. Users will see a DeprecationWarning when importing the module, giving them time to complete their schema migrations. Co-Authored-By: Claude Opus 4.5 --- src/datajoint/migrate.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/datajoint/migrate.py b/src/datajoint/migrate.py index 579d16642..29eb3aa24 100644 --- a/src/datajoint/migrate.py +++ b/src/datajoint/migrate.py @@ -5,6 +5,10 @@ Codec system, particularly for upgrading blob columns to use explicit `` type declarations. +.. deprecated:: 2.0.0 + This module is deprecated and will be removed in DataJoint 2.2. + Complete your migrations before upgrading to 2.2. + Note on Terminology ------------------- This module uses "external storage" because that was the term in DataJoint 0.14.6. @@ -16,10 +20,18 @@ import logging import re +import warnings from typing import TYPE_CHECKING from .errors import DataJointError +warnings.warn( + "datajoint.migrate is deprecated and will be removed in DataJoint 2.2. " + "Complete your schema migrations before upgrading to 2.2.", + DeprecationWarning, + stacklevel=2, +) + if TYPE_CHECKING: from .schemas import Schema From 1ceabd55551dcd2b40811aaeff2137fae5f2d90b Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Tue, 3 Feb 2026 10:41:16 -0600 Subject: [PATCH 2/4] deprecate: Show warning only in 2.1+, update messaging - Module is temporary, provided to assist migration from pre-2.0 - Deprecation warning only appears in 2.1+ - Will be removed in 2.2 Co-Authored-By: Claude Opus 4.5 --- src/datajoint/migrate.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/datajoint/migrate.py b/src/datajoint/migrate.py index 29eb3aa24..78c8524d3 100644 --- a/src/datajoint/migrate.py +++ b/src/datajoint/migrate.py @@ -5,9 +5,10 @@ Codec system, particularly for upgrading blob columns to use explicit `` type declarations. -.. deprecated:: 2.0.0 - This module is deprecated and will be removed in DataJoint 2.2. - Complete your migrations before upgrading to 2.2. +.. note:: + This module is provided temporarily to assist with migration from pre-2.0. + It will be deprecated in DataJoint 2.1 and removed in 2.2. + Complete your migrations while on DataJoint 2.0. Note on Terminology ------------------- @@ -24,13 +25,16 @@ from typing import TYPE_CHECKING from .errors import DataJointError - -warnings.warn( - "datajoint.migrate is deprecated and will be removed in DataJoint 2.2. " - "Complete your schema migrations before upgrading to 2.2.", - DeprecationWarning, - stacklevel=2, -) +from . import __version__ + +# Show deprecation warning starting in 2.1 +if __version__ >= "2.1": + warnings.warn( + "datajoint.migrate is deprecated and will be removed in DataJoint 2.2. " + "Complete your schema migrations before upgrading.", + DeprecationWarning, + stacklevel=2, + ) if TYPE_CHECKING: from .schemas import Schema From 4c1be52079e9c9611875f077c238f1b375e15049 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Tue, 3 Feb 2026 10:46:54 -0600 Subject: [PATCH 3/4] fix: Use packaging.version for proper version comparison String comparison fails for versions like "2.10" vs "2.2" Co-Authored-By: Claude Opus 4.5 --- src/datajoint/migrate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/datajoint/migrate.py b/src/datajoint/migrate.py index 78c8524d3..b2454f5db 100644 --- a/src/datajoint/migrate.py +++ b/src/datajoint/migrate.py @@ -24,11 +24,13 @@ import warnings from typing import TYPE_CHECKING +from packaging.version import Version + from .errors import DataJointError from . import __version__ # Show deprecation warning starting in 2.1 -if __version__ >= "2.1": +if Version(__version__) >= Version("2.1"): warnings.warn( "datajoint.migrate is deprecated and will be removed in DataJoint 2.2. " "Complete your schema migrations before upgrading.", From 0ebce4c03e7e1502d81dc09f21af323d2eaff250 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Tue, 3 Feb 2026 11:14:58 -0600 Subject: [PATCH 4/4] fix: Import __version__ from .version to avoid circular import Co-Authored-By: Claude Opus 4.5 --- src/datajoint/migrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datajoint/migrate.py b/src/datajoint/migrate.py index b2454f5db..d48afae62 100644 --- a/src/datajoint/migrate.py +++ b/src/datajoint/migrate.py @@ -27,7 +27,7 @@ from packaging.version import Version from .errors import DataJointError -from . import __version__ +from .version import __version__ # Show deprecation warning starting in 2.1 if Version(__version__) >= Version("2.1"):