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

added JSONReader to file mappings #14419

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

denen99
Copy link
Contributor

@denen99 denen99 commented Jun 26, 2024

Description

The default_file_reader_cls dict that maps file extensions to the proper XReader, did not include a mapping for the new JSONreader. This PR adds the mapping for .json files to the JSONReader

Fixes # (issue)

New Package?

Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?

  • Yes
  • [ x ] No

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating? (Except for the llama-index-core package)

  • Yes
  • [ x ] No

Type of Change

Bugfix

Please delete options that are not relevant.

  • [ x ] Bug fix (non-breaking change which fixes an issue)
  • [ x ] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added new unit/integration tests
  • Added new notebook (that tests end-to-end)
  • [ x ] I stared at the code and made sure it makes sense

Suggested Checklist:

  • [ x ] 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
  • I have added Google Colab support for the newly added notebooks.
  • [ x ] My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • [ x ] New and existing unit tests pass locally with my changes
  • [ x ] I ran make format; make lint to appease the lint gods

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 26, 2024
Copy link
Contributor

@nerdai nerdai left a comment

Choose a reason for hiding this comment

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

Thanks @denen99. I've left a comment in my review. I don't think will be able to bring in the JSONReader in the way that you've got it currently.

@@ -63,6 +63,8 @@ def _try_loading_included_file_formats() -> Dict[str, Type[BaseReader]]:
PptxReader,
VideoAudioReader,
) # pants: no-infer-dep

from llama_index.readers import JSONReader
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you may be using a legacy version of llama_index (i.e., v0.9.4x and earlier)?

JSONReader is available in our integration package call llama-index-readers-json which isn't included as a dependency in the umbrella llama-index package. Since we don't include that in that umbrella package, we don't try to import it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants