Skip to content

Commit

Permalink
community[patch]: support numpy2 (#28184)
Browse files Browse the repository at this point in the history
Follows on from #27991, updates the langchain-community package to
support numpy 2 versions

---------

Co-authored-by: Chester Curme <[email protected]>
  • Loading branch information
ghinch and ccurme authored Nov 27, 2024
1 parent 0901f11 commit 5141f25
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .github/scripts/check_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ def _get_configs_for_single_dir(job: str, dir_: str) -> List[Dict[str, str]]:
py_versions = ["3.9", "3.13"]

elif dir_ == "libs/community" and job == "extended-tests":
# community extended test resolution in 3.12 is slow
# even in uv
py_versions = ["3.9", "3.11"]
py_versions = ["3.9", "3.12"]

elif dir_ == "libs/community" and job == "compile-integration-tests":
# community integration deps are slow in 3.12
Expand Down
1 change: 0 additions & 1 deletion libs/community/extended_testing_deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ openai<2
openapi-pydantic>=0.3.2,<0.4
oracle-ads>=2.9.1,<3
oracledb>=2.2.0,<3
outlines[test]>=0.1.0,<0.2
pandas>=2.0.1,<3
pdfminer-six>=20221105,<20240706
pgvector>=0.1.6,<0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ def similarity_search_by_vector_returning_embeddings(
k: int,
filter: Optional[Dict[str, Any]] = None,
**kwargs: Any,
) -> List[Tuple[Document, float, np.ndarray[np.float32, Any]]]:
) -> List[Tuple[Document, float, np.ndarray]]:
embedding_arr: Any
if self.insert_mode == "clob":
embedding_arr = json.dumps(embedding)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def similarity_search_by_vector_returning_embeddings(
k: int,
filter: Optional[Dict[str, Any]] = None,
postgrest_filter: Optional[str] = None,
) -> List[Tuple[Document, float, np.ndarray[np.float32, Any]]]:
) -> List[Tuple[Document, float, np.ndarray]]:
match_documents_params = self.match_args(query, filter)
query_builder = self._client.rpc(self.query_name, match_documents_params)

Expand Down
66 changes: 65 additions & 1 deletion libs/community/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/community/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ version = ">=1.22.4,<2"
python = "<3.12"

[[tool.poetry.dependencies.numpy]]
version = ">=1.26.2,<2"
version = ">=1.26.2,<3"
python = ">=3.12"

[tool.ruff.lint]
Expand Down

0 comments on commit 5141f25

Please sign in to comment.