mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #21239] [CLOSED] fix: use keyword arg for IndicesClient.refresh() (opensearch-py 3.x) #41615
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/21239
Author: @veeceey
Created: 2/7/2026
Status: ❌ Closed
Base:
dev← Head:fix/issue-20649-opensearch-refresh-kwarg📝 Commits (1)
06ffb9bfix: use keyword argument for IndicesClient.refresh() for opensearch-py 3.x📊 Changes
1 file changed (+3 additions, -3 deletions)
View changed files
📝
backend/open_webui/retrieval/vector/dbs/opensearch.py(+3 -3)📄 Description
Pull Request Checklist
devbranch.Changelog Entry
Description
In
opensearch-py >= 3.0.0(pinned at3.1.0inrequirements.txt),IndicesClient.refresh()changed its API signature: theindexparameter became keyword-only. The existing code passes it as a positional argument, causingTypeError: IndicesClient.refresh() takes 1 positional argument but 2 positional arguments (and 2 keyword-only arguments) were givenon every document upload, upsert, or delete operation with the OpenSearch vector database backend.Fixed
self.client.indices.refresh(self._get_index_name(collection_name))toself.client.indices.refresh(index=self._get_index_name(collection_name))in all three calls:insert()method (after bulk indexing)upsert()method (after bulk upsert)delete()method (after bulk delete / delete_by_query)Test Results
Before fix:
Document upload to knowledge bases with OpenSearch backend fails completely.
After fix:
All other client calls in the file (
create,delete,exists,search,get,delete_by_query) already use keyword arguments correctly. Onlyrefresh()was missed.Fixes #20649
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.