Skip to content

Commit

Permalink
fix: add backup import for ujson_dumps from pandas.io.json (#5496)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang authored Nov 22, 2024
1 parent 69b6594 commit c463d57
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/phoenix/utilities/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@

import numpy as np
import pandas as pd
from pandas.io.json import build_table_schema, ujson_dumps # type: ignore
from pandas.io.json import build_table_schema
from pandas.io.json._table_schema import parse_table_schema # type: ignore
from strawberry import UNSET
from strawberry.types.base import StrawberryObjectDefinition

try:
from pandas.io.json import ujson_dumps # type: ignore
except ImportError:
# https://github.com/pandas-dev/pandas/pull/54581
from pandas.io.json import dumps as ujson_dumps # type: ignore


def jsonify(obj: Any) -> Any:
"""
Expand Down

0 comments on commit c463d57

Please sign in to comment.