Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit edad8e2

Browse files
committed
Fix snowflake date formatting
1 parent 1fbc008 commit edad8e2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

data_diff/databases/snowflake.py

+7
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ def md5_as_hex(self, s: str) -> str:
8181
return f"md5({s})"
8282

8383
def normalize_timestamp(self, value: str, coltype: TemporalType) -> str:
84+
try:
85+
is_date = coltype.is_date
86+
except:
87+
is_date = False
88+
if isinstance(coltype, Date) or is_date:
89+
return f"({value}::varchar)"
90+
8491
if coltype.rounds:
8592
timestamp = f"to_timestamp(round(date_part(epoch_nanosecond, convert_timezone('UTC', {value})::timestamp(9))/1000000000, {coltype.precision}))"
8693
else:

0 commit comments

Comments
 (0)