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: postgresql read schema_info with characters truncated if too long #1935

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

bigcash
Copy link
Contributor

@bigcash bigcash commented Aug 30, 2024

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:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added the fix Bug fixes label Aug 30, 2024
Copy link
Collaborator

@csunny csunny left a comment

Choose a reason for hiding this comment

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

r+, thank for your contribution, and congratulations on being the 100th contributor.

Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

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

r+

@Aries-ckt Aries-ckt merged commit 8c6d96c into eosphoros-ai:main Sep 2, 2024
5 checks passed
Hopshine pushed a commit to Hopshine/DB-GPT that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants