Skip to content

fix: Use keyword argument for IndicesClient.refresh() opensearch-py >= 3.0.0#20748

Closed
YuriNachos wants to merge 1 commit intoopen-webui:devfrom
YuriNachos:fix-20649-opensearch-refresh
Closed

fix: Use keyword argument for IndicesClient.refresh() opensearch-py >= 3.0.0#20748
YuriNachos wants to merge 1 commit intoopen-webui:devfrom
YuriNachos:fix-20649-opensearch-refresh

Conversation

@YuriNachos
Copy link

Description

Added

  • N/A

Changed

  • Changed IndicesClient.refresh() calls to use keyword argument index= instead of positional argument

Deprecated

  • N/A

Removed

  • N/A

Fixed

  • OpenSearch integration: Fixed TypeError when uploading documents to knowledge base with OpenSearch backend
  • In opensearch-py >= 3.0.0, IndicesClient.refresh() method signature changed to only accept keyword-only arguments
  • Changed: self.client.indices.refresh(self._get_index_name(collection_name))
  • To: self.client.indices.refresh(index=self._get_index_name(collection_name))

Security

  • N/A

Breaking Changes

  • N/A

Additional Information

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.

…= 3.0.0

Fixes open-webui#20649

In opensearch-py >= 3.0.0, the IndicesClient.refresh() method signature
changed to only accept keyword-only arguments. The previous code called
it with a positional argument, causing TypeError.

Changed:
  self.client.indices.refresh(self._get_index_name(collection_name))
To:
  self.client.indices.refresh(index=self._get_index_name(collection_name))

This fix is applied to all occurrences in the OpenSearchClient class.
@pr-validator-bot
Copy link

👋 Welcome and Thank You for Contributing!

We appreciate you taking the time to submit a pull request to Open WebUI!

⚠️ Important: Testing Requirements

We've recently seen an increase in PRs that have significant issues:

  • PRs that don't actually fix the bug they claim to fix
  • PRs that don't implement the feature they describe
  • PRs that break existing functionality
  • PRs that are clearly AI-generated without proper testing being done by the author
  • PRs that simply don't work as intended

These untested PRs consume significant time from maintainers and volunteer contributors who review and test PRs in their free time.
Time that could be spent testing other PRs or improving Open WebUI in other ways.

Before marking your PR as "Ready for Review":

Please explicitly confirm:

  1. ✅ You have personally tested ALL changes in this PR
  2. How you tested it (specific steps you took to verify it works)
  3. Visual evidence where applicable (screenshots or videos showing the feature/fix working) - if applicable to your specific PR

If you're not certain your PR works exactly as intended, please leave it in DRAFT mode until you've thoroughly tested it.

Thank you for helping us maintain quality and respecting the time of our community! 🙏

@Classic298
Copy link
Collaborator

Did you test this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants