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

Fix frozen model issue #4230

Merged
merged 1 commit into from
Mar 7, 2025
Merged

Fix frozen model issue #4230

merged 1 commit into from
Mar 7, 2025

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Mar 7, 2025

Description

SearchQuery is frozen, can't update like that.

How Has This Been Tested?

👀

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@Weves Weves requested a review from a team as a code owner March 7, 2025 17:03
Copy link

vercel bot commented Mar 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 7, 2025 5:05pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR fixes an issue with the frozen SearchQuery Pydantic model by properly using model_copy() instead of copy() when creating query variations for multilingual search.

  • Modified retrieve_chunks() in /backend/onyx/context/search/retrieval/search_runner.py to use model_copy() with a single update dictionary, respecting Pydantic's immutability design
  • The change ensures thread-safety by preventing accidental modifications to frozen models while maintaining the same multilingual search functionality

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@evan-danswer evan-danswer left a comment

Choose a reason for hiding this comment

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

LGTM

@Weves Weves merged commit 9e8eba2 into main Mar 7, 2025
7 of 11 checks passed
@Weves Weves deleted the fix-frozen-model-issue branch March 7, 2025 17:05
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.

2 participants