diff --git a/neptyne_kernel/json_tools.py b/neptyne_kernel/json_tools.py index c76fc37..20d9644 100644 --- a/neptyne_kernel/json_tools.py +++ b/neptyne_kernel/json_tools.py @@ -21,6 +21,9 @@ def json_default(obj: Any) -> str | int | list | float | None: except ImportError: from jupyter_client.jsonutil import date_default as jupyter_json_default + if hasattr(obj, "__json__"): + obj = obj.__json__() + return jupyter_json_default(obj) diff --git a/neptyne_kernel/requirements-extras.in b/neptyne_kernel/requirements-extras.in index b43a9c2..26adb74 100644 --- a/neptyne_kernel/requirements-extras.in +++ b/neptyne_kernel/requirements-extras.in @@ -15,7 +15,6 @@ graphlib html5lib isoweek jaconv -json-fix mapboxgl mapclassify markdown diff --git a/neptyne_kernel/requirements.txt b/neptyne_kernel/requirements.txt index 43a72ec..927c1c7 100644 --- a/neptyne_kernel/requirements.txt +++ b/neptyne_kernel/requirements.txt @@ -278,8 +278,6 @@ joblib==1.3.2 # via # contextily # scikit-learn -json-fix==0.3.0 - # via -r neptyne_kernel/requirements-extras.in jsonschema==4.5.1 # via # altair diff --git a/neptyne_kernel/widgets/base_widget.py b/neptyne_kernel/widgets/base_widget.py index 5de8e55..5682289 100644 --- a/neptyne_kernel/widgets/base_widget.py +++ b/neptyne_kernel/widgets/base_widget.py @@ -11,11 +11,6 @@ from enum import Enum from typing import Any, Callable -try: - import json_fix # pylint: disable=unused-import # noqa: F401 -except ImportError: - pass - from ..cell_api import CellApiMixin, CellEvent from ..neptyne_protocol import MIMETypes from ..util import list_like diff --git a/requirements-dev.txt b/requirements-dev.txt index a08dbdc..7c371f4 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -441,8 +441,6 @@ joblib==1.3.2 # -r requirements.txt # contextily # scikit-learn -json-fix==0.3.0 - # via -r neptyne_kernel/requirements-extras.in jsonschema==4.5.1 # via # -r requirements.txt diff --git a/requirements.in b/requirements.in index 62c8dc5..c124d28 100644 --- a/requirements.in +++ b/requirements.in @@ -39,7 +39,6 @@ ipython~=8.3.0 isort isoweek jaconv -json-fix jupyter_client kaleido kubernetes_asyncio diff --git a/requirements.txt b/requirements.txt index 15e31f7..544f372 100644 --- a/requirements.txt +++ b/requirements.txt @@ -323,8 +323,6 @@ jiter==0.5.0 # via anthropic joblib==1.3.2 # via scikit-learn -json-fix==1.0.0 - # via -r requirements.in jsonschema==4.5.1 # via # altair