Skip to content

Commit 4e4b945

Browse files
committed
Fix LowCardinality and Nullable alembic generation xzkostyan#217
1 parent 8787870 commit 4e4b945

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clickhouse_sqlalchemy/types/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Nullable(ClickHouseTypeEngine):
5252
__visit_name__ = 'nullable'
5353

5454
def __init__(self, nested_type):
55-
self.nested_type = nested_type
55+
self.nested_type = to_instance(nested_type)
5656
super(Nullable, self).__init__()
5757

5858

@@ -64,7 +64,7 @@ class LowCardinality(ClickHouseTypeEngine):
6464
__visit_name__ = 'lowcardinality'
6565

6666
def __init__(self, nested_type):
67-
self.nested_type = nested_type
67+
self.nested_type = to_instance(nested_type)
6868
super(LowCardinality, self).__init__()
6969

7070

tests/test_reflection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_nullable(self):
6262

6363
self.assertIsInstance(col['type'], types.Nullable)
6464
self.assertTrue(col['nullable'])
65-
self.assertEqual(col['type'].nested_type, types.Int32)
65+
self.assertIsInstance(col['type'].nested_type, types.Int32)
6666

6767
def test_not_null(self):
6868
metadata = self.metadata()
@@ -84,7 +84,7 @@ def test_low_cardinality(self):
8484
)[0]['type']
8585

8686
self.assertIsInstance(coltype, types.LowCardinality)
87-
self.assertEqual(coltype.nested_type, types.String)
87+
self.assertIsInstance(coltype.nested_type, types.String)
8888

8989
def test_tuple(self):
9090
coltype = self._type_round_trip(

0 commit comments

Comments
 (0)