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

Commit 70afc1e

Browse files
committed
Fixes
1 parent 7e0770e commit 70afc1e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

data_diff/databases/base.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,17 @@ def _refine_coltypes(self, table_path: DbPath, col_dict: Dict[str, ColType]):
200200

201201
fields = [self.normalize_uuid(c, ColType_UUID()) for c in text_columns]
202202
samples_by_row = self.query(Select(fields, TableName(table_path), limit=16), list)
203-
samples_by_col = list(zip(*samples_by_row))
204-
if not samples_by_col:
203+
if not samples_by_row:
204+
logger.warning(f"Table {table_path} is empty.")
205205
return
206206

207+
samples_by_col = list(zip(*samples_by_row))
208+
207209
for col_name, samples in safezip(text_columns, samples_by_col):
208-
non_null_samples = [sample for sample in samples if sample is not None]
209-
uuid_samples = list(filter(is_uuid, non_null_samples))
210+
uuid_samples = [s for s in samples if s and is_uuid(s)]
210211

211212
if uuid_samples:
212-
if len(uuid_samples) != len(non_null_samples):
213+
if len(uuid_samples) != len(samples):
213214
logger.warning(
214215
f"Mixed UUID/Non-UUID values detected in column {'.'.join(table_path)}.{col_name}, disabling UUID support."
215216
)

data_diff/databases/mysql.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class MySQL(ThreadedDatabase):
2626
"char": Text,
2727
"varbinary": Text,
2828
"binary": Text,
29-
"text": Text
3029
}
3130
ROUNDS_ON_PREC_LOSS = True
3231

0 commit comments

Comments
 (0)