Skip to content

Commit

Permalink
removing json-stream dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Eldies committed Mar 11, 2025
1 parent ff35cd0 commit 8d4701b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
3 changes: 0 additions & 3 deletions requirements-core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ tabulate
# prune
scikit-learn

# Stream JSON parser
json-stream

# TabularValidator
nltk

Expand Down
11 changes: 1 addition & 10 deletions src/datumaro/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from functools import wraps
from inspect import isclass
from itertools import islice
from typing import Any, Callable, Dict, Iterable, Tuple, TypeVar, Union
from typing import Any, Callable, Iterable, Tuple, TypeVar, Union

import attrs
import orjson
from json_stream.base import StreamingJSONList, StreamingJSONObject

NOTSET = object()

Expand Down Expand Up @@ -204,11 +203,3 @@ def dump_json_file(

def current_function_name(depth=1):
return inspect.getouterframes(inspect.currentframe())[depth].function


def to_dict_from_streaming_json(obj: Any) -> Dict[str, Any]:
if isinstance(obj, StreamingJSONObject):
return {k: to_dict_from_streaming_json(v) for k, v in obj.items()}
if isinstance(obj, StreamingJSONList):
return [to_dict_from_streaming_json(v) for v in obj]
return obj

0 comments on commit 8d4701b

Please sign in to comment.