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

KuzuGraph not working #11874

Closed
14 tasks
decentropy opened this issue Oct 16, 2023 · 5 comments
Closed
14 tasks

KuzuGraph not working #11874

decentropy opened this issue Oct 16, 2023 · 5 comments
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@decentropy
Copy link

System Info

Name: kuzu
Version: 0.0.10 (latest)

Name: langchain
Version: 0.0.311

Who can help?

No response

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

I am using the example from langchain documentation:
https://python.langchain.com/docs/use_cases/graph/graph_kuzu_qa

This line fails:
graph = KuzuGraph(db)

F```
ile ~/.local/lib/python3.10/site-packages/langchain/graphs/kuzu_graph.py:71, in KuzuGraph.refresh_schema(self)
69 for table in rel_tables:
70 current_table_schema = {"properties": [], "label": table["name"]}
---> 71 properties_text = self.conn._connection.get_rel_property_names(
72 table["name"]
73 ).split("\n")
74 for i, line in enumerate(properties_text):
75 # The first 3 lines defines src, dst and name, so we skip them
76 if i < 3:

AttributeError: 'kuzu._kuzu.Connection' object has no attribute 'get_rel_property_names'


### Expected behavior

should work like example
@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Oct 16, 2023
@dosubot
Copy link

dosubot bot commented Oct 16, 2023

🤖

Hello,

Thank you for reaching out and providing detailed information about the issue you're facing. The error you're encountering, 'kuzu._kuzu.Connection' object has no attribute 'get_rel_property_names', is due to the fact that the 'get_rel_property_names' method does not exist in the 'kuzu._kuzu.Connection' class.

This method is called in the 'refresh_schema' method of the 'KuzuGraph' class in LangChain:

properties_text = self.conn._connection.get_rel_property_names(
    table["name"]
).split("\n")

However, as per the error message, there is no such method in the 'kuzu._kuzu.Connection' class, hence the AttributeError.

To resolve this issue, you need to check the Kuzu documentation or source code to find the correct method for retrieving relationship property names. If you're unsure, you may need to reach out to the maintainers of the Kuzu library for further assistance.

Regarding your question about the changes made to the LangChain codebase between version 0.0.311 and the latest version 0.0.315, I'm afraid I don't have that information at the moment. However, you can check the release notes or the commit history in the LangChain repository for this information.

I hope this helps. If you have any other questions or need further clarification, please don't hesitate to ask.

Best regards,
Dosu

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@yzhang1918
Copy link

The method "get_rel_property_names" has been removed since kuzu 0.0.10.

Check this PR: kuzudb/kuzu#2207

A temporary solution is to use kuzu==0.0.9

pip install kuzu==0.0.9

Copy link

dosubot bot commented Feb 3, 2024

Hi, @decentropy,

I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, the issue you reported regarding the KuzuGraph not working as expected and throwing an AttributeError related to the 'get_rel_property_names' method has been resolved. The 'get_rel_property_names' method has been removed since kuzu 0.0.10, and users are advised to use kuzu==0.0.9 as a temporary solution.

Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days.

Thank you for your understanding and cooperation. If you have any further questions or concerns, feel free to reach out.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Feb 3, 2024
@karbasia
Copy link
Contributor

karbasia commented Feb 5, 2024

I've created a PR to resolve this issue: #16885

@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Feb 5, 2024
baskaryan pushed a commit that referenced this issue Feb 15, 2024
- **Description:** Updates to the Kuzu API had broken this
functionality. These updates resolve those issues and add a new test to
demonstrate the updates.
- **Issue:** #11874
- **Dependencies:** No new dependencies
- **Twitter handle:** @amirk08


Test results:
```
tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_query_no_params PASSED                                   [ 33%]
tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_query_params PASSED                                      [ 66%]
tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_refresh_schema PASSED                                    [100%]

=================================================== slowest 5 durations =================================================== 
0.53s call     tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_refresh_schema
0.34s call     tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_query_no_params
0.28s call     tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_query_params
0.03s teardown tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_refresh_schema
0.02s teardown tests/integration_tests/graphs/test_kuzu.py::TestKuzu::test_query_params
==================================================== 3 passed in 1.27s ==================================================== 
```
@baskaryan
Copy link
Collaborator

Should be fixed in #16885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants