-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
🐛BSomething isn't workingSomething isn't working
Description
Bug Description
When comparing two instances of Mmif I get an error.
Reproduction steps
Here is some minimal code to replicate this:
from mmif import Mmif
minimal_mmif = '''
{
"metadata": {
"mmif": "http://mmif.clams.ai/1.0.0"
},
"documents": [
{
"@type": "http://mmif.clams.ai/vocabulary/VideoDocument/v1",
"properties": {
"mime": "video",
"id": "d1",
"location": "file:///mnt/llc/llc_data/clams/chyron-batch-running/cpb-aacip-507-154dn40c26.mp4"
}
}
],
"views": []
}'''
m1 = Mmif(minimal_mmif)
m2 = Mmif(minimal_mmif)
m1 == m2Expected behavior
No response
Log output
$ python test_mmif_equality.py
Traceback (most recent call last):
File "/Users/marc/Documents/git/clams/aapb-brandeis-datahousing/test.py", line 27, in <module>
m1 == m2
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/mmif/serialize/model.py", line 270, in __eq__
len(DeepDiff(self, other, report_repetition=True, exclude_types=[datetime],
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 361, in __init__
self._diff(root, parents_ids=frozenset({id(t1)}), _original_type=_original_type)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 1747, in _diff
self._diff_obj(level, parents_ids)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 494, in _diff_obj
self._diff_dict(
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 706, in _diff_dict
self._diff(next_level, parents_ids_added, local_tree=local_tree)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 1741, in _diff
self._diff_iterable(level, parents_ids, _original_type=_original_type, local_tree=local_tree)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 753, in _diff_iterable
self._diff_iterable_in_order(level, parents_ids, _original_type=_original_type, local_tree=local_tree)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 884, in _diff_iterable_in_order
self._diff_by_forming_pairs_and_comparing_one_by_one(
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 976, in _diff_by_forming_pairs_and_comparing_one_by_one
self._diff(next_level, parents_ids_added, local_tree=local_tree)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 1747, in _diff
self._diff_obj(level, parents_ids)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/diff.py", line 480, in _diff_obj
t1 = detailed__dict__(level.t1, ignore_private_variables=self.ignore_private_variables)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/deepdiff/helper.py", line 742, in detailed__dict__
value = getattr(obj, key)
File "/Applications/ADDED/venv/clams/datahouse/lib/python3.10/site-packages/mmif/serialize/annotation.py", line 374, in text_language
raise ValueError("Only TextDocument can have `text` field.")
ValueError: Only TextDocument can have `text` field.Screenshots
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
🐛BSomething isn't workingSomething isn't working
Type
Projects
Status
Done