mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-07-31 10:19:58 +03:00
Fixed bug in final() method engine validation
This commit is contained in:
parent
7f38f8c654
commit
76dfdb6012
|
@ -1,4 +1,5 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import six
|
import six
|
||||||
import pytz
|
import pytz
|
||||||
from copy import copy
|
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.
|
Adds a FINAL modifier to table, meaning data will be collapsed to final version.
|
||||||
Can be used with CollapsingMergeTree engine only
|
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')
|
raise TypeError('final() method can be used only with CollapsingMergeTree engine')
|
||||||
|
|
||||||
qs = copy(self)
|
qs = copy(self)
|
||||||
|
|
|
@ -419,7 +419,7 @@ class SampleModel(Model):
|
||||||
|
|
||||||
class SampleCollapsingModel(SampleModel):
|
class SampleCollapsingModel(SampleModel):
|
||||||
|
|
||||||
sign = UInt8Field(default=1)
|
sign = Int8Field(default=1)
|
||||||
|
|
||||||
engine = CollapsingMergeTree('materialized_date', ('num',), 'sign')
|
engine = CollapsingMergeTree('materialized_date', ('num',), 'sign')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user