Skip to content

Commit bbbfbc3

Browse files
Remove legacy compatibility shims: attribute_adapter.py, bypass_serialization
Breaking changes: - Remove attribute_adapter.py entirely (hard deprecate) - Remove bypass_serialization flag from blob.py - blobs always serialize now - Remove unused 'database' field from Attribute in heading.py Import get_adapter from attribute_type instead of attribute_adapter. Co-authored-by: dimitri-yatsenko <dimitri@datajoint.com>
1 parent 328a59a commit bbbfbc3

File tree

5 files changed

+2
-113
lines changed

5 files changed

+2
-113
lines changed

src/datajoint/attribute_adapter.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/datajoint/blob.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@
5656

5757
compression = {b"ZL123\0": zlib.decompress}
5858

59-
bypass_serialization = False # runtime setting to bypass blob (en|de)code
60-
6159
# runtime setting to read integers as 32-bit to read blobs created by the 32-bit
6260
# version of the mYm library for MATLAB
6361
use_32bit_dims = False
@@ -507,17 +505,9 @@ def pack(self, obj, compress):
507505

508506

509507
def pack(obj, compress=True):
510-
if bypass_serialization:
511-
# provide a way to move blobs quickly without de/serialization
512-
assert isinstance(obj, bytes) and obj.startswith((b"ZL123\0", b"mYm\0", b"dj0\0"))
513-
return obj
514508
return Blob().pack(obj, compress=compress)
515509

516510

517511
def unpack(blob, squeeze=False):
518-
if bypass_serialization:
519-
# provide a way to move blobs quickly without de/serialization
520-
assert isinstance(blob, bytes) and blob.startswith((b"ZL123\0", b"mYm\0", b"dj0\0"))
521-
return blob
522512
if blob is not None:
523513
return Blob(squeeze=squeeze).unpack(blob)

src/datajoint/declare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import pyparsing as pp
1111

12-
from .attribute_adapter import get_adapter
12+
from .attribute_type import get_adapter
1313
from .condition import translate_attribute
1414
from .errors import DataJointError
1515
from .settings import config

src/datajoint/heading.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy as np
77

8-
from .attribute_adapter import get_adapter
8+
from .attribute_type import get_adapter
99
from .attribute_type import AttributeType
1010
from .declare import (
1111
CORE_TYPE_NAMES,
@@ -65,7 +65,6 @@ def decode(self, stored, *, key=None):
6565
store=None,
6666
unsupported=False,
6767
attribute_expression=None,
68-
database=None,
6968
dtype=object,
7069
)
7170

@@ -282,7 +281,6 @@ def _init_from_database(self):
282281
for attr in attributes:
283282
attr.update(
284283
in_key=(attr["in_key"] == "PRI"),
285-
database=database,
286284
nullable=attr["nullable"] == "YES",
287285
autoincrement=bool(re.search(r"auto_increment", attr["Extra"], flags=re.I)),
288286
numeric=any(TYPE_PATTERN[t].match(attr["type"]) for t in ("DECIMAL", "INTEGER", "FLOAT")),

tests/test_bypass_serialization.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)