diff --git a/src/infi/clickhouse_orm/query.py b/src/infi/clickhouse_orm/query.py index 5dfd660..be1b015 100644 --- a/src/infi/clickhouse_orm/query.py +++ b/src/infi/clickhouse_orm/query.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals + import six import pytz from copy import copy @@ -408,7 +409,7 @@ class QuerySet(object): Adds a FINAL modifier to table, meaning data will be collapsed to final version. Can be used with CollapsingMergeTree engine only """ - if not issubclass(self._model_cls, CollapsingMergeTree): + if not isinstance(self._model_cls.engine, CollapsingMergeTree): raise TypeError('final() method can be used only with CollapsingMergeTree engine') qs = copy(self) diff --git a/tests/test_querysets.py b/tests/test_querysets.py index 0fcc871..6410672 100644 --- a/tests/test_querysets.py +++ b/tests/test_querysets.py @@ -419,7 +419,7 @@ class SampleModel(Model): class SampleCollapsingModel(SampleModel): - sign = UInt8Field(default=1) + sign = Int8Field(default=1) engine = CollapsingMergeTree('materialized_date', ('num',), 'sign')