Skip to content

Commit 36f3bb7

Browse files
committed
Merge pre/v2.0
2 parents 8ee058a + 6bce2a5 commit 36f3bb7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/datajoint/declare.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
UUID_DATA_TYPE = "binary(16)"
1818

1919
# Type aliases for numeric types
20-
TYPE_ALIASES = {
20+
SQL_TYPE_ALIASES = {
2121
"FLOAT32": "float",
2222
"FLOAT64": "double",
2323
"INT64": "bigint",
@@ -80,7 +80,7 @@
8080
"FILEPATH",
8181
"OBJECT",
8282
"ADAPTED",
83-
} | set(TYPE_ALIASES)
83+
} | set(SQL_TYPE_ALIASES)
8484
NATIVE_TYPES = set(TYPE_PATTERN) - SPECIAL_TYPES
8585
EXTERNAL_TYPES = {
8686
"EXTERNAL_ATTACH",
@@ -492,8 +492,8 @@ def substitute_special_type(match, category, foreign_key_sql, context):
492492
if category in SPECIAL_TYPES:
493493
# recursive redefinition from user-defined datatypes.
494494
substitute_special_type(match, category, foreign_key_sql, context)
495-
elif category in TYPE_ALIASES:
496-
match["type"] = TYPE_ALIASES[category]
495+
elif category in SQL_TYPE_ALIASES:
496+
match["type"] = SQL_TYPE_ALIASES[category]
497497
else:
498498
assert False, "Unknown special type"
499499

tests/test_type_aliases.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import pytest
66

7-
from datajoint.declare import TYPE_ALIASES, SPECIAL_TYPES, match_type
7+
from datajoint.declare import SQL_TYPE_ALIASES, SPECIAL_TYPES, match_type
88

99
from .schema_type_aliases import TypeAliasTable, TypeAliasPrimaryKey, TypeAliasNullable
1010

@@ -33,7 +33,7 @@ def test_type_alias_pattern_matching(self, alias, expected_category):
3333
category = match_type(alias)
3434
assert category == expected_category
3535
assert category in SPECIAL_TYPES
36-
assert category in TYPE_ALIASES
36+
assert category in SQL_TYPE_ALIASES
3737

3838
@pytest.mark.parametrize(
3939
"alias,expected_mysql_type",
@@ -54,7 +54,7 @@ def test_type_alias_pattern_matching(self, alias, expected_category):
5454
def test_type_alias_mysql_mapping(self, alias, expected_mysql_type):
5555
"""Test that type aliases map to correct MySQL types."""
5656
category = match_type(alias)
57-
mysql_type = TYPE_ALIASES[category]
57+
mysql_type = SQL_TYPE_ALIASES[category]
5858
assert mysql_type == expected_mysql_type
5959

6060
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)