mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #21208] [CLOSED] fix: use keyword args for IndicesClient.refresh() (opensearch-py >= 3.0.0) #25967
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21208
Author: @veeceey
Created: 2/6/2026
Status: ❌ Closed
Base:
main← Head:fix/issue-20649-opensearch-refresh-kwarg📝 Commits (1)
39ee0a3fix: use keyword args for IndicesClient.refresh() (opensearch-py >= 3.0.0)📊 Changes
2 files changed (+345 additions, -3 deletions)
View changed files
📝
backend/open_webui/retrieval/vector/dbs/opensearch.py(+3 -3)➕
backend/open_webui/test/apps/webui/routers/test_opensearch.py(+342 -0)📄 Description
Summary
Fixes #20649
In
opensearch-py >= 3.0.0, all auto-generated API methods switched to keyword-only arguments. The three calls toIndicesClient.refresh()in the OpenSearch vector DB client were passing the index name as a positional argument, causing:This made it impossible to add documents to a knowledge base when using OpenSearch as the vector DB backend.
Changes
backend/open_webui/retrieval/vector/dbs/opensearch.py- Changed all 3 call sites from positional to keyword argument:Affected methods:
insert()(line 214),upsert()(line 237),delete()(line 266).backend/open_webui/test/apps/webui/routers/test_opensearch.py- Added 9 unit tests that:refresh()call sites useindex=keyword argumentTest evidence
All 9 tests PASS with the fix applied:
Key test FAILS on the unfixed (original) code:
To verify the tests correctly detect the bug, I reverted the fix and ran the critical test:
This confirms the test correctly reproduces the exact
TypeErrorfrom issue #20649 on unfixed code, and the fix resolves it.Test plan
index=keyword arg is backward-compatible with opensearch-py < 3.0.0🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.