Fixed bug in final() method engine validation

This commit is contained in:
M1ha 2018-12-11 16:47:00 +05:00
parent 7f38f8c654
commit 76dfdb6012
2 changed files with 3 additions and 2 deletions

View File

@ -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)

View File

@ -419,7 +419,7 @@ class SampleModel(Model):
class SampleCollapsingModel(SampleModel):
sign = UInt8Field(default=1)
sign = Int8Field(default=1)
engine = CollapsingMergeTree('materialized_date', ('num',), 'sign')