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

community[patch]: support numpy2 #28184

Merged
merged 10 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -140 to -141
Copy link
Collaborator

Choose a reason for hiding this comment

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

@efriis FYI removing this cap because dependency resolution appears to go reasonably fast in 3.12 now.

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Verified that we don't lose any coverage with this as we're not decorating any tests with @pytest.mark.requires for outlines.

Extended tests run before removal: https://github.com/langchain-ai/langchain/actions/runs/12053796858/job/33610328589

After removal: https://github.com/langchain-ai/langchain/actions/runs/12053978122/job/33610948323?pr=28184

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
Loading