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

feat: Add options for what to do with missing metadata fields in MetaFieldRanker #7700

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

robpasternak
Copy link
Member

Related Issues

        :param missing_meta:
            What to do with documents that are missing the sorting metadata field.
            Possible values are:
            - 'drop' will drop the documents entirely.
            - 'top' will place the documents at the top of the metadata-sorted list
                (regardless of 'ascending' or 'descending').
            - 'bottom' will place the documents at the bottom of metadata-sorted list
                (regardless of 'ascending' or 'descending').

Proposed Changes:

  • The missing_meta param has three options: "bottom", "top", and "drop".
    • Using "bottom" exhibits the same behavior as was implemented prior to this PR, i.e., documents without the sorting metadata field are put on the bottom of the sorted list.
    • Using "top" puts them at the top instead.
    • Using "drop" drops such documents entirely.
  • Validation was added to ensure that the value of missing_meta is legit.
  • Tests were added for the new functionality.

How did you test it?

Wrote and tried new tests functions in the test directory:

  • test_raises_value_error_if_wrong_missing_meta: Tests validation of missing_meta
  • test_missing_meta_bottom: Tests that missing_meta = "bottom" behaves as desired.
  • test_missing_meta_top: Tests that missing_meta = "top" behaves as desired.
  • test_missing_meta_drop: Tests that missing_meta = "drop" behaves as desired.

Notes for the reviewer

None

Checklist

@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels May 15, 2024
@coveralls
Copy link
Collaborator

coveralls commented May 15, 2024

Pull Request Test Coverage Report for Build 9174873156

Details

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

Totals Coverage Status
Change from base Build 9129529675: 0.02%
Covered Lines: 6598
Relevant Lines: 7285

💛 - Coveralls

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.

MetaFieldRanker: allow different options for what to do with missing metadata field
2 participants