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