Fix: Invalid data type for the value of modes#2931
Open
waleedabdeen wants to merge 1 commit into
Open
Conversation
- Serialized the `modes` parameter in the step to a JSON formatted string. This resolves issue Chainlit#2930.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses the issue where the modes parameter was being passed as a dictionary rather than a JSON string. This caused a data type mismatch when inserting/updating the step in the database, leading to an error. This resolves issue #2930.
Problem Identification:
The existing code was passing the modes field directly without serializing it to a JSON string. Causing the step insert queries to fail.
Solution:
A single line of code (line 402) has been added in
backend/chainlit/sql_alchemy.py::SQLAlchemyDataLayerto serialize the modes parameter to a JSON formatted string before being inserted into the database:Impact:
Fixed the data type issue when interacting with the database.
Ensured that the modes parameter is correctly stored and can be queried in the future.
Summary by cubic
Serialize the
modesfield to a JSON string before DB insert/update to fix the data type mismatch that caused step writes to fail.Written for commit 5430cb1. Summary will update on new commits. Review in cubic