mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 09:06:41 +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)
|
||||||
|
try:
|
||||||
result = list(self.database.select(sql))
|
result = list(self.database.select(sql))
|
||||||
logging.info('\t==> %s', result[0].value if result else '<empty>')
|
logging.info('\t==> %s', result[0].value if result else '<empty>')
|
||||||
if expected_value != NO_VALUE:
|
if expected_value != NO_VALUE:
|
||||||
self.assertEqual(result[0].value, expected_value)
|
self.assertEqual(result[0].value, expected_value)
|
||||||
return result[0].value if result else None
|
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