Skip to content

Commit d4faadc

Browse files
Merge pull request #1373 from datajoint/deprecate/migrate-module
deprecate: Add deprecation warning to migrate module
2 parents 68f8137 + 0ebce4c commit d4faadc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/datajoint/migrate.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
Codec system, particularly for upgrading blob columns to use
66
explicit `<blob>` type declarations.
77
8+
.. note::
9+
This module is provided temporarily to assist with migration from pre-2.0.
10+
It will be deprecated in DataJoint 2.1 and removed in 2.2.
11+
Complete your migrations while on DataJoint 2.0.
12+
813
Note on Terminology
914
-------------------
1015
This module uses "external storage" because that was the term in DataJoint 0.14.6.
@@ -16,9 +21,22 @@
1621

1722
import logging
1823
import re
24+
import warnings
1925
from typing import TYPE_CHECKING
2026

27+
from packaging.version import Version
28+
2129
from .errors import DataJointError
30+
from .version import __version__
31+
32+
# Show deprecation warning starting in 2.1
33+
if Version(__version__) >= Version("2.1"):
34+
warnings.warn(
35+
"datajoint.migrate is deprecated and will be removed in DataJoint 2.2. "
36+
"Complete your schema migrations before upgrading.",
37+
DeprecationWarning,
38+
stacklevel=2,
39+
)
2240

2341
if TYPE_CHECKING:
2442
from .schemas import Schema

0 commit comments

Comments
 (0)