llama-hub
llama-hub copied to clipboard
Atlassian confluence connector doesn't work
Fails with the following error message:
Traceback (most recent call last):
File "/Users/debabrata/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.3345.131/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Users/debabrata/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.3345.131/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/debabrata/projects/wiki/main.py", line 15, in <module>
load_confluence_data()
File "/Users/debabrata/projects/wiki/confluence_fetcher.py", line 12, in load_confluence_data
documents = reader.load_data(space_key=space_key, include_attachments=True)
File "/Users/debabrata/.pyenv/versions/gpt-index/lib/python3.9/site-packages/llama_index/readers/llamahub_modules/confluence/base.py", line 89, in load_data
doc = self.process_page(page, include_attachments, text_maker)
File "/Users/debabrata/.pyenv/versions/gpt-index/lib/python3.9/site-packages/llama_index/readers/llamahub_modules/confluence/base.py", line 136, in process_page
text = text_maker.handle(page['body']['storage']['value']) + "".join(attachment_texts)
KeyError: 'body'
I believe the issue is on this line: https://github.com/emptycrown/llama-hub/blob/88df41a27cc0f7796b3b6c2d715673ed673752e5/loader_hub/confluence/base.py#L76
It works as expected if you change it from:
pages_iter = self.confluence.get_all_pages_from_space(space_key, start=start, limit=limit)
To:
pages_iter = self.confluence.get_all_pages_from_space(space_key, start=start, limit=limit, expand='body.storage')
If you're loading by Page IDs or CQL, you'll need to change the expand
kwarg value to 'body.storage'
.
This has been fixed for a while now.