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

Commit 9d2cd65

Browse files
authored
Merge pull request #830 from datafold/databricks_decimal_precision_scale
keep precision, scale info for databricks decimal
2 parents e3f6315 + 060e8cb commit 9d2cd65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

data_diff/databases/databricks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def _process_table_schema(
186186

187187
resulted_rows = []
188188
for info in col_infos:
189+
raw_data_type = info.data_type
189190
row_type = "DECIMAL" if info.data_type.startswith("DECIMAL") else info.data_type
190191
info = attrs.evolve(info, data_type=row_type)
191192
type_cls = self.dialect.TYPE_CLASSES.get(row_type, UnknownColType)
@@ -198,7 +199,7 @@ def _process_table_schema(
198199
info = attrs.evolve(info, numeric_precision=numeric_precision)
199200

200201
elif issubclass(type_cls, Decimal):
201-
items = info.data_type[8:].rstrip(")").split(",")
202+
items = raw_data_type[8:].rstrip(")").split(",")
202203
numeric_precision, numeric_scale = int(items[0]), int(items[1])
203204
info = attrs.evolve(
204205
info,

0 commit comments

Comments
 (0)