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

'NoneType' object has no attribute 'get' when using neo4j as graph storage #108

Open
RuiC8 opened this issue Dec 13, 2024 · 0 comments
Open

Comments

@RuiC8
Copy link

RuiC8 commented Dec 13, 2024

First, I tried to use the default graph_storage (NetworkXStorage) to build graphrag, and it run successfully. After I switched to Neo4j graph storage, I received the following error when building the graphrag. Does anyone know how to resolve this issue?

AttributeError                            Traceback (most recent call last)
Cell In[17], line 2
      1 with open("[./example_data/rm.txt](https://vscode-remote+ssh-002dremote-002b10-002e0-002e30-002e50.vscode-resource.vscode-cdn.net./example_data/rm.txt)") as f:
----> 2     graph_func.insert(f.read())

File [~/notebooks/KG/GraphRAG/nano-graphrag/nano_graphrag/graphrag.py:207](https://vscode-remote+ssh-002dremote-002b10-002e0-002e30-002e50.vscode-resource.vscode-cdn.net/home/rchen/notebooks/KG/GraphRAG/test_src/GRAG_tools/~/notebooks/KG/GraphRAG/nano-graphrag/nano_graphrag/graphrag.py:207), in GraphRAG.insert(self, string_or_strings)
    205 def insert(self, string_or_strings):
    206     loop = always_get_an_event_loop()
--> 207     return loop.run_until_complete(self.ainsert(string_or_strings))

File [~/miniconda3/envs/graph_env/lib/python3.9/site-packages/nest_asyncio.py:98](https://vscode-remote+ssh-002dremote-002b10-002e0-002e30-002e50.vscode-resource.vscode-cdn.net/KG/GraphRAG/test_src/GRAG_tools/~/miniconda3/envs/graph_env/lib/python3.9/site-packages/nest_asyncio.py:98), in _patch_loop..run_until_complete(self, future)
     95 if not f.done():
     96     raise RuntimeError(
     97         'Event loop stopped before Future completed.')
---> 98 return f.result()

File [~/miniconda3/envs/graph_env/lib/python3.9/asyncio/futures.py:201](https://vscode-remote+ssh-002dremote-002b10-002e0-002e30-002e50.vscode-resource.vscode-cdn.net/KG/GraphRAG/test_src/GRAG_tools/~/miniconda3/envs/graph_env/lib/python3.9/asyncio/futures.py:201), in Future.result(self)
    199 self.__log_traceback = False
    200 if self._exception is not None:
--> 201     raise self._exception
    202 return self._result

File [~/miniconda3/envs/graph_env/lib/python3.9/asyncio/tasks.py:256](https://vscode-remote+ssh-002dremote-002b10-002e0-002e30-002e50.vscode-resource.vscode-cdn.net/KG/GraphRAG/test_src/GRAG_tools/~/miniconda3/envs/graph_env/lib/python3.9/asyncio/tasks.py:256), in Task.__step(***failed resolving arguments***)
    252 try:
...
    508 edges_may_truncate_list_data = truncate_list_by_token_size(
    509     edges_list_data, key=lambda x: x[3], max_token_size=max_token_size [/](https://vscode-remote+ssh-002dremote-002b10-002e0-002e30-002e50.vscode-resource.vscode-cdn.net/)[/](https://vscode-remote+ssh-002dremote-002b10-002e0-002e30-002e50.vscode-resource.vscode-cdn.net/) 2
    510 )

AttributeError: 'NoneType' object has no attribute 'get'

The graphrag with neo4j is initialized as follows:

graph_func = GraphRAG(
    graph_storage_cls=Neo4jStorage,
    addon_params=config,
    working_dir=WORKING_DIR,
    enable_llm_cache=True,
    best_model_max_async=5,
    cheap_model_max_async=5,
    embedding_func=local_embedding,
    entity_extraction_func=extract_entities_dspy
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant