Skip to content

Commit e202818

Browse files
committed
refactor: simplify bool type alias to only support 'bool'
1 parent d68ea68 commit e202818

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

docs/src/design/tables/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ libraries, making table definitions more readable and explicit about data precis
8585

8686
| Alias | MySQL Type | Description |
8787
|-------|------------|-------------|
88-
| `bool` / `boolean` | `tinyint` | Boolean value (0 or 1) |
88+
| `bool` | `tinyint` | Boolean value (0 or 1) |
8989
| `int8` | `tinyint` | 8-bit signed integer (-128 to 127) |
9090
| `uint8` | `tinyint unsigned` | 8-bit unsigned integer (0 to 255) |
9191
| `int16` | `smallint` | 16-bit signed integer (-32,768 to 32,767) |

src/datajoint/declare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
UINT16=r"uint16$",
5252
INT8=r"int8$",
5353
UINT8=r"uint8$",
54-
BOOL=r"bool(ean)?$", # aliased to tinyint
54+
BOOL=r"bool$", # aliased to tinyint
5555
# Native MySQL types
5656
INTEGER=r"((tiny|small|medium|big|)int|integer)(\s*\(.+\))?(\s+unsigned)?(\s+auto_increment)?|serial$",
5757
DECIMAL=r"(decimal|numeric)(\s*\(.+\))?(\s+unsigned)?$",

tests/test_type_aliases.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class TestTypeAliasPatterns:
2626
("int8", "INT8"),
2727
("uint8", "UINT8"),
2828
("bool", "BOOL"),
29-
("boolean", "BOOL"),
3029
],
3130
)
3231
def test_type_alias_pattern_matching(self, alias, expected_category):
@@ -50,7 +49,6 @@ def test_type_alias_pattern_matching(self, alias, expected_category):
5049
("int8", "tinyint"),
5150
("uint8", "tinyint unsigned"),
5251
("bool", "tinyint"),
53-
("boolean", "tinyint"),
5452
],
5553
)
5654
def test_type_alias_mysql_mapping(self, alias, expected_mysql_type):

0 commit comments

Comments
 (0)