mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-25 18:23:44 +03:00
Ignore functions that don't exist in the used ClickHouse version
This commit is contained in:
parent
bde5c75eba
commit
efebfc67ed
|
@ -30,11 +30,17 @@ class FuncsTestCase(TestCaseWithData):
|
||||||
def _test_func(self, func, expected_value=NO_VALUE):
|
def _test_func(self, func, expected_value=NO_VALUE):
|
||||||
sql = 'SELECT %s AS value' % func.to_sql()
|
sql = 'SELECT %s AS value' % func.to_sql()
|
||||||
logging.info(sql)
|
logging.info(sql)
|
||||||
result = list(self.database.select(sql))
|
try:
|
||||||
logging.info('\t==> %s', result[0].value if result else '<empty>')
|
result = list(self.database.select(sql))
|
||||||
if expected_value != NO_VALUE:
|
logging.info('\t==> %s', result[0].value if result else '<empty>')
|
||||||
self.assertEqual(result[0].value, expected_value)
|
if expected_value != NO_VALUE:
|
||||||
return result[0].value if result else None
|
self.assertEqual(result[0].value, expected_value)
|
||||||
|
return result[0].value if result else None
|
||||||
|
except ServerError as e:
|
||||||
|
if 'Unknown function' in e.message:
|
||||||
|
logging.warning(e.message)
|
||||||
|
return # ignore functions that don't exist in the used ClickHouse version
|
||||||
|
raise
|
||||||
|
|
||||||
def _test_aggr(self, func, expected_value=NO_VALUE):
|
def _test_aggr(self, func, expected_value=NO_VALUE):
|
||||||
qs = Person.objects_in(self.database).aggregate(value=func)
|
qs = Person.objects_in(self.database).aggregate(value=func)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user