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

community: Implement lazy_load() for JSONLoader #18643

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Mar 6, 2024

Covered by tests/unit_tests/document_loaders/test_json_loader.py

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 6, 2024
Copy link

vercel bot commented Mar 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Mar 6, 2024 11:36pm

@dosubot dosubot bot added Ɑ: doc loader Related to document loader module (not documentation) 🤖:improvement Medium size change to existing code to handle new use-cases labels Mar 6, 2024
@eyurtsev eyurtsev self-requested a review March 6, 2024 18:16
"""Load and return documents from the JSON file."""
docs: List[Document] = []
index = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having trouble to follow the logic here -- it looks like it's possible for multiple documents to be associated with the same seq_num do you know if this is the desired/correct behavior?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

2 docs shouldn't have the same seq_num.
The index from which the seq_num is started is incremented at each doc that is yielded so it should be good.
The test https://github.com/langchain-ai/langchain/blob/master/libs/community/tests/unit_tests/document_loaders/test_json_loader.py#L179 normally validates that it works.
Are you seeing something that is wrong ?

@eyurtsev eyurtsev self-requested a review March 6, 2024 18:22
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Mar 8, 2024
@eyurtsev eyurtsev merged commit ead2a74 into langchain-ai:master Mar 8, 2024
59 checks passed
@cbornet cbornet deleted the lazy-load-json branch March 8, 2024 22:11
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
Covered by `tests/unit_tests/document_loaders/test_json_loader.py`
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
Covered by `tests/unit_tests/document_loaders/test_json_loader.py`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: doc loader Related to document loader module (not documentation) 🤖:improvement Medium size change to existing code to handle new use-cases lgtm PR looks good. Use to confirm that a PR is ready for merging. size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants