mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2025-08-02 03:00:09 +03:00
added validation for final and test
This commit is contained in:
parent
5f2825b9f2
commit
c1f14b4dad
|
@ -538,10 +538,10 @@ class QuerySet(object):
|
|||
def final(self):
|
||||
"""
|
||||
Adds a FINAL modifier to table, meaning data will be collapsed to final version.
|
||||
Can be used with the `CollapsingMergeTree` and `ReplacingMergeTree` engines only.
|
||||
Can be used with the `CollapsingMergeTree`, `ReplacingMergeTree` and `AggregatingMergeTree` engines only.
|
||||
"""
|
||||
from .engines import CollapsingMergeTree, ReplacingMergeTree
|
||||
if not isinstance(self._model_cls.engine, (CollapsingMergeTree, ReplacingMergeTree)):
|
||||
from .engines import CollapsingMergeTree, ReplacingMergeTree, AggregatingMergeTree
|
||||
if not isinstance(self._model_cls.engine, (CollapsingMergeTree, ReplacingMergeTree, AggregatingMergeTree)):
|
||||
raise TypeError('final() method can be used only with the CollapsingMergeTree and ReplacingMergeTree engines')
|
||||
|
||||
qs = copy(self)
|
||||
|
|
|
@ -73,6 +73,11 @@ class EnginesTestCase(_EnginesHelperTestCase):
|
|||
engine = ReplacingMergeTree('date', ('date', 'event_id', 'event_group'), 'event_uversion')
|
||||
self._create_and_insert(TestModel)
|
||||
|
||||
def test_aggregating_merge_tree(self):
|
||||
class TestModel(SampleModel):
|
||||
engine = AggregatingMergeTree('date', ('date', 'event_group'))
|
||||
self._create_and_insert(TestModel)
|
||||
|
||||
def test_tiny_log(self):
|
||||
class TestModel(SampleModel):
|
||||
engine = TinyLog()
|
||||
|
|
Loading…
Reference in New Issue
Block a user