Skip to content

fix: UnboundLocalError for msg in create_search_response #2162

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

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

kristenarmes
Copy link
Contributor

Description

Initialize the msg and status_code variables at the top of the create_search_response util function for the search proxy

Motivation and Context

We were getting this exception: UnboundLocalError: local variable 'msg' referenced before assignment
To mitigate this, now initialize the variables that were previously only set within the for loop at the top of the function.

CheckList

  • PR title addresses the issue accurately and concisely
  • Updates Documentation and Docstrings
  • Adds tests
  • Adds instrumentation (logs, or UI events)

Signed-off-by: Kristen Armes <[email protected]>
@boring-cyborg boring-cyborg bot added the area:search From the search folder label Jun 8, 2023
Copy link
Contributor

@allisonsuarez allisonsuarez left a comment

Choose a reason for hiding this comment

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

thank you!

@kristenarmes kristenarmes marked this pull request as ready for review June 8, 2023 18:43
@kristenarmes kristenarmes requested a review from a team as a code owner June 8, 2023 18:43
@kristenarmes kristenarmes merged commit fda780a into main Jun 8, 2023
@kristenarmes kristenarmes deleted the karmes-fix-search-response-function branch June 8, 2023 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:search From the search folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants