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

Commit 6ef0a07

Browse files
committed
Fix for BigQuery
1 parent 154f2de commit 6ef0a07

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

data_diff/database.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,10 +816,12 @@ def normalize_value_by_type(self, value: str, coltype: ColType) -> str:
816816

817817
timestamp6 = f"FORMAT_TIMESTAMP('%F %H:%M:%E6S', {value})"
818818
return f"RPAD(LEFT({timestamp6}, {TIMESTAMP_PRECISION_POS+coltype.precision}), {TIMESTAMP_PRECISION_POS+6}, '0')"
819+
elif isinstance(coltype, Integer):
820+
pass
819821

820822
elif isinstance(coltype, NumericType):
821823
# value = f"cast({value} as decimal)"
822-
return f"format('%.{coltype.precision}f', cast({value} as decimal))"
824+
return f"format('%.{coltype.precision}f', ({value}))"
823825

824826
return self.to_string(f"{value}")
825827

0 commit comments

Comments
 (0)