From ab6effcf59661bb411853b4d8a889b4f75f98c8c Mon Sep 17 00:00:00 2001 From: "zhuoyu.chen" <> Date: Mon, 24 Mar 2025 12:00:43 +0800 Subject: [PATCH 1/2] [fix] json serializable exception --- desktop/libs/notebook/src/notebook/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/libs/notebook/src/notebook/models.py b/desktop/libs/notebook/src/notebook/models.py index 4ef3923261c..9f597b676c2 100644 --- a/desktop/libs/notebook/src/notebook/models.py +++ b/desktop/libs/notebook/src/notebook/models.py @@ -15,7 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json +import simplejson as json import math import uuid import logging @@ -53,7 +53,7 @@ def escape_rows(rows, nulls_only=False, encoding=None): for field in row: if isinstance(field, numbers.Number): - if math.isnan(field) or math.isinf(field): + if math.isnan(field) or math.isinf(field) or len(str(field)) > 16: escaped_field = json.dumps(field) else: escaped_field = field From 906d35856436651a06ed9ffb8567dd09b69e477d Mon Sep 17 00:00:00 2001 From: "zhuoyu.chen" <> Date: Mon, 24 Mar 2025 12:01:34 +0800 Subject: [PATCH 2/2] [fix] json serializable exception --- desktop/core/base_requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop/core/base_requirements.txt b/desktop/core/base_requirements.txt index 4bea36ccab9..cf861dbc5bc 100644 --- a/desktop/core/base_requirements.txt +++ b/desktop/core/base_requirements.txt @@ -70,6 +70,7 @@ thrift-sasl==0.4.3 django-utils-six==2.0 six==1.16.0 psutil==5.8.0 +simplejson==3.20.1 drf-spectacular[sidecar]==0.27.2 -e file://${ROOT}/desktop/core/ext-py3/boto-2.49.0 -e file://${ROOT}/desktop/core/ext-py3/django-axes-5.13.0