Update dependency opensearch-py to v3#2764
Conversation
f606c4b to
5b40116
Compare
5b40116 to
93a5755
Compare
8adeaf9 to
baf968b
Compare
1d7f163 to
1ee3df6
Compare
33154e1 to
d04160a
Compare
2e7388f to
74b3109
Compare
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
| @@ -74,7 +74,7 @@ ocw-data-parser = "^0.35.1" | |||
| onnxruntime = "1.22.1" | |||
| openai = "^2.0.0" | |||
| opensearch-dsl = "^2.0.0" | |||
There was a problem hiding this comment.
Bug: The project relies on the deprecated opensearch-dsl package, which may be incompatible with the newly upgraded opensearch-py v3.0.0, creating a risk of runtime errors.
Severity: MEDIUM
Suggested Fix
Remove the opensearch-dsl dependency from pyproject.toml. Refactor the code to use the DSL functionality now built into the opensearch-py library. This involves updating all imports from opensearch_dsl (e.g., Search, Percolate) to use the corresponding helpers from opensearch-py.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: pyproject.toml#L76
Potential issue: The pull request upgrades `opensearch-py` to version 3.0.0 but
continues to use the `opensearch-dsl` package, which was deprecated and had its
functionality merged into `opensearch-py` starting with version 2.2.0. The
`opensearch-dsl` version 2.1.0 was designed to work with `opensearch-py` version 2.x.
Relying on this deprecated package alongside a new major version of `opensearch-py`
creates a risk of runtime incompatibilities, as the internal APIs that `opensearch-dsl`
depends on may have changed or been removed in `opensearch-py` v3.0.0. This could lead
to unexpected behavior or errors when DSL-related features are executed.
| @@ -74,7 +74,7 @@ ocw-data-parser = "^0.35.1" | |||
| onnxruntime = "1.22.1" | |||
| openai = "^2.0.0" | |||
| opensearch-dsl = "^2.0.0" | |||
There was a problem hiding this comment.
Bug: The upgrade of opensearch-py to v3.0.0 while opensearch-dsl remains at v2.x may introduce runtime incompatibilities due to breaking changes in the underlying client library.
Severity: MEDIUM
Suggested Fix
Verify through testing that opensearch-dsl v2.1.0 is compatible with opensearch-py v3.0.0. If they are incompatible, upgrade opensearch-dsl to a version that officially supports opensearch-py v3.0.0. Alternatively, revert the opensearch-py upgrade until a compatible opensearch-dsl version is available.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: pyproject.toml#L76
Potential issue: The pull request upgrades `opensearch-py` to version 3.0.0, a major
release with breaking changes, while the `opensearch-dsl` library remains at version
2.1.0. Although the dependency manager resolves these versions without conflict, there
is a risk of runtime errors. `opensearch-dsl` relies heavily on the `opensearch-py`
client, and breaking changes in the client's API could cause `opensearch-dsl` functions
used throughout the application to fail. This potential incompatibility could lead to
failures in search-related operations.
| "openai>=2.0.0,<3", | ||
| "opensearch-dsl>=2.0.0,<3", | ||
| "opensearch-py>=2.0.0,<3", | ||
| "opensearch-py>=3.1,<4", |
There was a problem hiding this comment.
Bug: Calls to the opensearch-py client use positional arguments, such as conn.indices.get_alias(temp_alias), which are no longer supported after the library upgrade and will cause a TypeError.
Severity: HIGH
Suggested Fix
Update all calls to the opensearch-py client to use keyword arguments instead of positional arguments. For example, change conn.indices.get_alias(temp_alias) to conn.indices.get_alias(name=temp_alias) and conn.indices.create(index_name, ...) to conn.indices.create(index=index_name, ...).
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: pyproject.toml#L73
Potential issue: The upgrade to `opensearch-py` v3.1.0 introduces a breaking change that
requires keyword-only arguments for API calls. The codebase contains several calls that
use positional arguments, which will now raise a `TypeError` at runtime. For example,
`conn.indices.get_alias(temp_alias)` in `create_backing_index` will fail during
reindexing operations, breaking the entire workflow. Other affected calls include
`conn.indices.refresh(index)`, `conn.indices.exists(alias)`, and
`conn.indices.create(index_name, ...)`. These will cause runtime errors when their
respective code paths are executed.
| "openai>=2.0.0,<3", | ||
| "opensearch-dsl>=2.0.0,<3", | ||
| "opensearch-py>=2.0.0,<3", | ||
| "opensearch-py>=3.1,<4", |
There was a problem hiding this comment.
Bug: The opensearch-dsl version is incompatible with the upgraded opensearch-py v3, which will likely cause runtime failures. The tests do not cover this incompatibility.
Severity: CRITICAL
Suggested Fix
Since opensearch-dsl is deprecated, the recommended fix is to migrate all code using opensearch-dsl APIs (like Search, MoreLikeThis, Percolate) to use the native opensearch-py v3 client directly. After the migration, the opensearch-dsl dependency should be removed from pyproject.toml.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: pyproject.toml#L73
Potential issue: The pull request upgrades `opensearch-py` to version 3, but leaves the
`opensearch-dsl` library at version 2. The documentation for `opensearch-dsl` v2
specifies a dependency on `opensearch-py` version 2 (`<3`), making it incompatible with
the newly upgraded version. The application uses `opensearch-dsl` for search
functionality, and this version mismatch will likely cause runtime errors such as
`TypeError` or `AttributeError` when `opensearch-dsl` makes calls to the underlying
`opensearch-py` client. The existing test suite will not detect this issue because it
mocks the client connections, bypassing the actual library interaction that would fail
in a live environment.
This PR contains the following updates:
>=2.0.0,<3→>=3.1,<4Release Notes
opensearch-project/opensearch-py (opensearch-py)
v3.1.0Compare Source
Added
Updated APIs
Changed
DenseVectorfield type toKnnVector(925)Deprecated
Removed
Fixed
Security
Dependencies
aiohttpfrom >=3.9.4,<4 to >=3.10.11,<4 (#920)aiohttpfrom >=3.10.11 to >=3.12.14 (#966)pytest-asynciofrom <=0.25.1 to <=1.2.0 (#936, #950)lycheeverse/lychee-actionfrom 1.9.3 to 2.7.0 (#946, #980)actions/download-artifactfrom 4 to 6 (#957, #968)actions/cachefrom 3 to 4 (#958)peter-evans/create-pull-requestfrom 6 to 7 (#959)actions/setup-pythonfrom 5 to 6 (#961)dangoslen/dependabot-changelog-helperfrom 3 to 4 (#960)stefanzweifel/git-auto-commit-actionfrom 5 to 7 (#962)actions/checkoutfrom 4 to 5 (#967)VachaShah/backportfrom 1.1.4 to 2.2.0 (#969)actions/github-scriptfrom 7 to 8 (#973)actions/upload-artifactfrom 4 to 5 (#972)actions/setup-javafrom 4 to 5 (#974)v3.0.0Compare Source
Added
search_afterparameter (859)Updated APIs
Changed
Deprecated
Removed
Fixed
Security
Dependencies
pytest-asynciofrom <=0.24.0 to <=0.25.1 (#881)Configuration
📅 Schedule: (in timezone US/Eastern)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.