Skip to content

Fix issue requiring to install spacy and rapidfuzz even if not used #337

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

Merged
merged 2 commits into from
May 13, 2025

Conversation

stellasia
Copy link
Contributor

@stellasia stellasia commented May 13, 2025

Description

Make spacy and rapidfuzz imports optional.

Need to add from __future__ import annotations to defer the evaluation of annotations, otherwise def _get_embedding(self, text: str) -> NDArray[np.float64]: is raising an error (symbol NDArray not found).

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

Complexity

Complexity: Low

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • Unit tests have been updated
  • E2E tests have been updated
  • Examples have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed
  • CHANGELOG.md updated if appropriate

@stellasia stellasia requested a review from a team as a code owner May 13, 2025 07:21
@stellasia stellasia requested a review from NathalieCharbel May 13, 2025 07:28
Copy link
Contributor

@NathalieCharbel NathalieCharbel left a comment

Choose a reason for hiding this comment

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

LGTM :)
thanks for the fix!

@stellasia stellasia merged commit 02abfb2 into neo4j:main May 13, 2025
7 checks passed
stellasia added a commit to stellasia/neo4j-graphrag-python that referenced this pull request May 15, 2025
…eo4j#337)

* Fix issue requiring to install spacy and rapidfuzz even if not used

* Update CHANGELOG and doc
stellasia added a commit that referenced this pull request May 15, 2025
…337)

* Fix issue requiring to install spacy and rapidfuzz even if not used

* Update CHANGELOG and doc
@stellasia stellasia deleted the fix/rapidfuzz-import branch May 21, 2025 19:29
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.

2 participants