Skip to content

Commit

Permalink
Make ingest work with label annotation type objects (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
munkyshi authored Feb 6, 2025
1 parent a300c1c commit ed91015
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions kolena/_experimental/classification/_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
from typing import TypeVar
from typing import Union

from pydantic.dataclasses import dataclass

from kolena._utils.pydantic_v1.dataclasses import dataclass
from kolena.annotation import Label
from kolena.annotation import ScoredLabel

Expand Down
2 changes: 2 additions & 0 deletions kolena/_utils/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ def toDict(self) -> Dict:


def _serialize_dataobject(x: Any) -> Any:
if isinstance(x, dict):
return {k: _serialize_dataobject(v) for k, v in x.items()}
if isinstance(x, list):
return [item._to_dict() if isinstance(item, DataObject) else item for item in x]

Expand Down

0 comments on commit ed91015

Please sign in to comment.