Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add __eq__ method to SparseEmbedding #7574

Merged
merged 4 commits into from
Apr 23, 2024
Merged

add __eq__ method to SparseEmbedding #7574

merged 4 commits into from
Apr 23, 2024

Conversation

anakin87
Copy link
Member

Related Issues

While working on hybrid retrieval, I noticed we lack a proper way to compare SparseEmbedding objects.

Proposed Changes:

Add an __eq__ method to SparseEmbedding class to compare two SparseEmbedding objects.

How did you test it?

CI, new test

Checklist

@anakin87 anakin87 requested review from a team as code owners April 22, 2024 16:30
@anakin87 anakin87 requested review from dfokina and silvanocerza and removed request for a team April 22, 2024 16:30
@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 labels Apr 22, 2024
@anakin87 anakin87 requested review from davidsbatista and removed request for silvanocerza April 22, 2024 16:30
@silvanocerza
Copy link
Contributor

Would it make more sense to make it a dataclass at this point? 🤔

@anakin87
Copy link
Member Author

@silvanocerza I don't expect many more changes and features to be added to this object.
Do you think it is better to have a dataclass?

@coveralls
Copy link
Collaborator

coveralls commented Apr 22, 2024

Pull Request Test Coverage Report for Build 8799970368

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 90.109%

Totals Coverage Status
Change from base Build 8799941330: 0.003%
Covered Lines: 6286
Relevant Lines: 6976

💛 - Coveralls

@anakin87 anakin87 requested a review from silvanocerza April 23, 2024 10:25
@silvanocerza
Copy link
Contributor

@anakin87 not essential probably but looking at the code the behaviour is really similar to a dataclass without being one.

Copy link
Contributor

@davidsbatista davidsbatista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me 👍🏽

@anakin87 anakin87 merged commit 19a46af into main Apr 23, 2024
23 checks passed
@anakin87 anakin87 deleted the sparse-emb-eq branch April 23, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants