Unsure if this would classify as a bug or a feature, but the Document equality method does a direct dict comparison between two documents.
I think this is potentially sub-optimal in regards to when the score value is set in the Document. It's possible that all other aspects of two Documents match except the score value could differ only slightly due to float imprecision. For example,
from haystack import Document
doc1 = Document(content="doc1", id="1", score=0.123456782)
doc2 = Document(content="doc1", id="1", score=0.12345678)
doc1 == doc2
# False
To me this feels misleading since I'd normally say these two Documents should be considered the same.
Unsure if this would classify as a bug or a feature, but the Document equality method does a direct dict comparison between two documents.
I think this is potentially sub-optimal in regards to when the score value is set in the Document. It's possible that all other aspects of two Documents match except the score value could differ only slightly due to float imprecision. For example,
To me this feels misleading since I'd normally say these two Documents should be considered the same.