fix: postgresql read schema_info with characters truncated if too long #1935
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.
Description
当使用postgresql数据库时,当读取表的字段较多时,这时使用sqlalchemy读取后并转为字符串后,会出现中间部分字段被”characters truncated“现象。debug查看变量发现,所有字段是都在的,只不过在加入大模型的prompt模板时,自动的toString功能会自动进行truncated。改问题记录在 1426
How Has This Been Tested?
使用postgresql数据库,并设计一个超过30个字段的表,且每个字段名称的长度约大于10个字符。这时,如果在chat dashboard时,生成的prompt中会发现有中间部分的字段名称被”characters truncated“了。更新本代码后,问题解决。
Snapshots:
Include snapshots for easier review.
Checklist: