mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
All datetime funcs cleared
This commit is contained in:
parent
4ab98688c9
commit
63ff322215
@ -20,6 +20,7 @@ from datetime64_extended_range.common import *
|
||||
# https://github.com/ClickHouse/ClickHouse/issues/22928 : toStartOf...() wrong when out of normal range
|
||||
# https://github.com/ClickHouse/ClickHouse/issues/22929 : toUnixTimestamp() exception when out of normal
|
||||
# https://github.com/ClickHouse/ClickHouse/issues/22930 : toWeek()
|
||||
# https://github.com/ClickHouse/ClickHouse/issues/22948 : toYearWeek()
|
||||
|
||||
xfails = {
|
||||
"type conversion/to int 8 16 32 64 128 256/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/16581#issuecomment-804360350")],
|
||||
@ -34,6 +35,7 @@ xfails = {
|
||||
"date time funcs/to start of :/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22928")],
|
||||
"date time funcs/to unix timestamp/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22929")],
|
||||
"date time funcs/to week/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22930")],
|
||||
"date time funcs/to year week/:": [(Fail, "https://github.com/ClickHouse/ClickHouse/issues/22948")],
|
||||
}
|
||||
|
||||
|
||||
|
@ -119,11 +119,13 @@ def to_day_of(self, py_func, ch_func):
|
||||
with When("I check each of the datetimes"):
|
||||
for dt in datetimes:
|
||||
for tz1, tz2 in itertools.product(timezones, timezones):
|
||||
with Example(f"{dt} {tz1} -> {tz2}"):
|
||||
with When(f"{dt} {tz1} -> {tz2}"):
|
||||
with By("Computing expected result using pytz"):
|
||||
time_tz1 = pytz.timezone(tz1).localize(dt)
|
||||
time_tz2 = time_tz1.astimezone(pytz.timezone(tz2))
|
||||
result = eval(f"time_tz2.timetuple().{py_func}")
|
||||
if py_func == "tm_wday":
|
||||
result += 1
|
||||
expected = f"{result}"
|
||||
with And(f"Forming a {ch_func} ClickHouse query"):
|
||||
dt_str = dt.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
Loading…
Reference in New Issue
Block a user