Fix tests that fail on older ClickHouse versions

This commit is contained in:
Itai Shirav 2020-05-29 12:23:20 +03:00
parent 0c2d0f0ffd
commit b2af10b11c

View File

@ -443,7 +443,7 @@ class F(Cond, FunctionOperatorsMixin, metaclass=FMeta):
@staticmethod
def toISOWeek(d, timezone=''):
return F('toISOWeek', d, timezone)
return F('toISOWeek', d, timezone) if timezone else F('toISOWeek', d)
@staticmethod
def toDayOfYear(d):
@ -531,15 +531,15 @@ class F(Cond, FunctionOperatorsMixin, metaclass=FMeta):
@staticmethod
def toYYYYMM(dt, timezone=''):
return F('toYYYYMM', dt, timezone)
return F('toYYYYMM', dt, timezone) if timezone else F('toYYYYMM', dt)
@staticmethod
def toYYYYMMDD(dt, timezone=''):
return F('toYYYYMMDD', dt, timezone)
return F('toYYYYMMDD', dt, timezone) if timezone else F('toYYYYMMDD', dt)
@staticmethod
def toYYYYMMDDhhmmss(dt, timezone=''):
return F('toYYYYMMDDhhmmss', dt, timezone)
return F('toYYYYMMDDhhmmss', dt, timezone) if timezone else F('toYYYYMMDDhhmmss', dt)
@staticmethod
def toRelativeYearNum(d, timezone=''):