Skip to content

Commit 45a94e1

Browse files
committed
refactor: rename TYPE_ALIASES to SQL_TYPE_ALIASES
1 parent e202818 commit 45a94e1

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",
@@ -78,7 +78,7 @@
7878
"EXTERNAL_BLOB",
7979
"FILEPATH",
8080
"ADAPTED",
81-
} | set(TYPE_ALIASES)
81+
} | set(SQL_TYPE_ALIASES)
8282
NATIVE_TYPES = set(TYPE_PATTERN) - SPECIAL_TYPES
8383
EXTERNAL_TYPES = {
8484
"EXTERNAL_ATTACH",
@@ -487,8 +487,8 @@ def substitute_special_type(match, category, foreign_key_sql, context):
487487
if category in SPECIAL_TYPES:
488488
# recursive redefinition from user-defined datatypes.
489489
substitute_special_type(match, category, foreign_key_sql, context)
490-
elif category in TYPE_ALIASES:
491-
match["type"] = TYPE_ALIASES[category]
490+
elif category in SQL_TYPE_ALIASES:
491+
match["type"] = SQL_TYPE_ALIASES[category]
492492
else:
493493
assert False, "Unknown special type"
494494

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)