Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests crash with ClickHouse 22.8 #204

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/infi/clickhouse_orm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ def create_ad_hoc_field(cls, db_type):
# Tuples (poor man's version - convert to array)
if db_type.startswith('Tuple'):
types = [s.strip() for s in db_type[6 : -1].split(',')]
assert len(set(types)) == 1, 'No support for mixed types in tuples - ' + db_type
if len(types[0].split()) != 1:
raise NotImplementedError('No support for named tuples - %s' % db_type)
if len(set(types)) != 1:
raise NotImplementedError('No support for mixed types in tuples - %s' % db_type)
inner_field = cls.create_ad_hoc_field(types[0])
return orm_fields.ArrayField(inner_field)
# FixedString
Expand Down
2 changes: 2 additions & 0 deletions tests/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def test_create_ad_hoc_field(self):
for row in self.database.select(query):
if row.type.startswith('Map'):
continue # Not supported yet
if 'Tuple' in row.type:
continue # Not fully supported yet
ModelBase.create_ad_hoc_field(row.type)

def test_get_model_for_table(self):
Expand Down