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

@W-17427085: Set ANNOY related dependencies to be optional #3858

Merged
merged 4 commits into from
Dec 19, 2024

Conversation

aditya-balachander
Copy link
Contributor

@aditya-balachander aditya-balachander commented Dec 13, 2024

Changes:

  • Remove "annoy", "numpy", "pandas", "scikit-learn" from dependencies under pyproject.toml and add them under optional dependencies
  • Created flag OPTIONAL_DEPENDENCIES_AVAILABLE, to indicate if ANNOY related dependencies are present in select_utils.py. If these optional dependencies are not available, for high volume of records (i.e. complexity_constant >= 1000), still Levenshtein Distance based selection will apply.
  • Skipped those pytests which have dependencies on pandas and ANNOY related optional dependencies under test_select_utils.py
  • Adding a warning message for non-zero similarity score when using ANNOY (for high volume of records). Updated the docs as well
  • Added additional workflow to run all unit tests with all optional dependencies installed

@aditya-balachander aditya-balachander requested a review from a team as a code owner December 13, 2024 06:03
mjawadtp
mjawadtp previously approved these changes Dec 13, 2024
Copy link
Contributor

@mjawadtp mjawadtp 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

Copy link
Contributor

@jstvz jstvz left a comment

Choose a reason for hiding this comment

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

Thanks for the updates, @aditya-balachander. The changes to make the optional dependencies conditional look good, but I recommend adding a new CI build that installs and tests with all optional dependencies (select). This will:

  • Make sure everything works when optional dependencies are installed together.
  • Catch compatibility issues early.

You can use the uv sync --all-extras command to install all optional dependencies. Let me know if you need help configuring the CI build to include this.

@aditya-balachander
Copy link
Contributor Author

Hey @jstvz,

Have added the additional workflow. Let me know if this looks good

Copy link
Contributor

@lakshmi2506 lakshmi2506 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mjawadtp mjawadtp 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

@vsbharath vsbharath merged commit 89a5b5d into main Dec 19, 2024
16 of 30 checks passed
@vsbharath vsbharath deleted the W-17427085/annoy_related_dependencies_optional branch December 19, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants