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(tugraph_store.py): _create_schema crash #2079

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tpoisonooo
Copy link
Contributor

Description

Fix tugraph creation error

How Has This Been Tested?

Here is my KG result

image

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

@tpoisonooo tpoisonooo changed the title Update tugraph_store.py fix(tugraph_store.py): _create_schema crash Oct 18, 2024
@github-actions github-actions bot added the fix Bug fixes label Oct 18, 2024
@Appointat
Copy link

@tpoisonooo Thanks so much for your PR.

Issue: when GraphRAG builds the DB schema, different versions of TuGraph handle the types STRING and "STRING" differently (one version supports STRING; while the other version supports "STRING"). It is caused by the TuGraph version update.

We fixed it in another PR (document structure search in GraphRAG), and will release it in the next released version of DB-GPT.

Solutions: We used statements createVertexLabelByJson and createEdgeLabelByJson to be compatible with the new and old versions of feat. (note: createVertexLabelByJson and createEdgeLabelByJson have not yet been updated in the official documentation of TuGraph)

            gql_data = json.dumps({
                "label": graph_elem_type.value,
                "type": "EDGE",
                "constraints": edge_direction(graph_elem_type),
                "properties": graph_properties,
            })
            gql = f"""CALL db.createEdgeLabelByJson('{data}')"""

Related issue [closed]: #2073

@csunny
Copy link
Collaborator

csunny commented Oct 18, 2024

@tpoisonooo Thanks for your contribution, we already fix this issue in another PR #2033 and will add you as a co-contributor about this issue #2073

@Appointat
Copy link

Appointat commented Oct 18, 2024

@tpoisonooo could you provide me your email?, so that I can add you to the contributors of pr #2033 (reply to me today if possible). :)

@Appointat
Copy link

@tpoisonooo you were added to the co-author of pr #2033. Thank you.
I think this pr can be closed now. : )

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