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

test: reorganize docstore test suite to isolate dataframe tests #8684

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Jan 7, 2025

Related Issues

Proposed Changes:

To initiate the removal of the dataframe field from Document, the first step would be to remove its support across all Document Stores.

Currently, most Document Stores test suites (in core-integrations) inherit from DocumentStoreBaseTests in Haystack.

In this PR, I'm isolating dataframe filter tests by removing them from FilterDocumentsTest (a part of DocumentStoreBaseTests) and grouping them into a new utility class, FilterDocumentsTestWithDataframe. This new class is not included in DocumentStoreBaseTests.

What will change after a Haystack release including this PR?

  • All Document Stores which inherit from DocumentStoreBaseTests or FilterDocumentsTest won't automatically test Documents containing dataframe.
  • To test dataframe functionality, one can inherit from FilterDocumentsTestWithDataframe.
  • This approach simplifies the eventual removal of dataframe support from Document Stores, avoiding the need to manually skip dataframe-specific test cases for each integration (a lot of manual work)

How did you test it?

(CI)
Manually updated the InMemoryDocumentStore tests to inherit from both FilterDocumentsTestWithDataframe and DocumentStoreBaseTests. All tests, including dataframe-related ones, executed as expected.

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@github-actions github-actions bot added the type:documentation Improvements on the docs label Jan 7, 2025
@coveralls
Copy link
Collaborator

coveralls commented Jan 7, 2025

Pull Request Test Coverage Report for Build 12672868712

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 91.024%

Files with Coverage Reduction New Missed Lines %
utils/callable_serialization.py 2 95.0%
Totals Coverage Status
Change from base Build 12598899410: 0.01%
Covered Lines: 8569
Relevant Lines: 9414

💛 - Coveralls

@anakin87 anakin87 changed the title chore: reorganize docstore test suite to isolate dataframe tests test: reorganize docstore test suite to isolate dataframe tests Jan 7, 2025
@anakin87 anakin87 marked this pull request as ready for review January 7, 2025 12:15
@anakin87 anakin87 requested review from a team as code owners January 7, 2025 12:15
@anakin87 anakin87 requested review from dfokina and Amnah199 and removed request for a team January 7, 2025 12:15
@anakin87 anakin87 marked this pull request as draft January 7, 2025 15:28
@anakin87 anakin87 marked this pull request as ready for review January 8, 2025 08:05
Copy link
Contributor

@Amnah199 Amnah199 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! 👍

@anakin87 anakin87 enabled auto-merge (squash) January 8, 2025 14:43
@anakin87 anakin87 merged commit bc30105 into main Jan 8, 2025
18 checks passed
@anakin87 anakin87 deleted the reorganize-testing-for-dataframes branch January 8, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants