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 TypeError in response handling with f-string formatting for suggestion values #29

Merged
merged 1 commit into from
Jan 5, 2025

Conversation

mugeshk97
Copy link
Contributor

This pull request addresses a TypeError encountered when concatenating a string with non-string values (such as integers) in the response processing logic. The issue was fixed by using f-string formatting to properly handle different data types in the suggestion values. This ensures that both int and str types are correctly converted to strings for concatenation.

Changes include:

  • Replaced manual string concatenation with f-strings for better handling of variable types.
  • Improved the readability and maintainability of the code by using a list comprehension for constructing the formatted response.

This fix ensures that the response handling logic works correctly even when var_body is an integer or other non-string type.

@chinganc chinganc added the bug Something isn't working label Jan 3, 2025
@chinganc chinganc self-assigned this Jan 3, 2025
@chinganc chinganc requested a review from allenanie January 3, 2025 19:35
@chinganc
Copy link
Collaborator

chinganc commented Jan 3, 2025

@allenanie can you take a look?

@allenanie allenanie merged commit 5856518 into microsoft:main Jan 5, 2025
3 checks passed
@mugeshk97 mugeshk97 deleted the fix/typeerror-render-opt-step branch January 6, 2025 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError in render_opt_step: Unsupported Operand Types for + ('int' and 'str')
3 participants