From fbab774a5ecb57edc3a15ee7d296d169bff35e64 Mon Sep 17 00:00:00 2001 From: "ram.yamasani@reachlocal.com" Date: Fri, 22 May 2026 10:20:23 -0700 Subject: [PATCH] DBE-3763 Fix for known issues --- data_diff/databases/mysql.py | 3 +++ data_diff/utils.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/data_diff/databases/mysql.py b/data_diff/databases/mysql.py index 1ee04460b..72665deee 100644 --- a/data_diff/databases/mysql.py +++ b/data_diff/databases/mysql.py @@ -8,6 +8,7 @@ Float, Decimal, Integer, + JSON, Text, TemporalType, FractionalType, @@ -68,6 +69,8 @@ class Dialect(BaseDialect): "tinytext": Text, # Boolean "boolean": Boolean, + # JSON + "json": JSON, } def quote(self, s: str) -> str: diff --git a/data_diff/utils.py b/data_diff/utils.py index 1d1405fdb..5c0ab2d0b 100644 --- a/data_diff/utils.py +++ b/data_diff/utils.py @@ -513,6 +513,13 @@ def diff_int_dynamic_color_template(diff_value: int) -> str: def _jsons_equiv(a: str, b: str): + # Treat Python None (DB null) as the JSON null literal so that a NULL on + # the MySQL side matches a 'null' string produced by TO_JSON_STRING(NULL) + # on the BigQuery side (or any other DB that serializes NULL as 'null'). + if a is None: + a = "null" + if b is None: + b = "null" try: return json.loads(a) == json.loads(b) except (ValueError, TypeError, json.decoder.JSONDecodeError): # not valid jsons