Skip to content

Commit 19f3e8b

Browse files
revert: drop "bytes"/"binary" blob type changes (MySQL+PG only)
These type names only appear with third-party adapters. Revert since we only support MySQL and PostgreSQL. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5bae415 commit 19f3e8b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/datajoint/codecs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def decode_attribute(attr, data, squeeze: bool = False, connection=None):
557557
# psycopg2 auto-deserializes JSON to dict/list; only parse strings
558558
if isinstance(data, str):
559559
data = json.loads(data)
560-
elif final_dtype.lower() in ("longblob", "blob", "mediumblob", "tinyblob", "bytes", "binary"):
560+
elif final_dtype.lower() in ("longblob", "blob", "mediumblob", "tinyblob"):
561561
pass # Blob data is already bytes
562562
elif final_dtype.lower() == "binary(16)":
563563
data = uuid_module.UUID(bytes=data)

src/datajoint/declare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ def compile_attribute(
916916
# Check for invalid default values on blob types (after type substitution)
917917
# Note: blob → longblob, so check for NATIVE_BLOB or longblob result
918918
final_type = match["type"].lower()
919-
if ("blob" in final_type or final_type == "binary") and match["default"] not in {"DEFAULT NULL", "NOT NULL"}:
919+
if ("blob" in final_type) and match["default"] not in {"DEFAULT NULL", "NOT NULL"}:
920920
raise DataJointError("The default value for blob attributes can only be NULL in:\n{line}".format(line=line))
921921

922922
# Use adapter to format column definition

0 commit comments

Comments
 (0)