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 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