-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
"""Load and return documents from the JSON file.""" | ||
docs: List[Document] = [] | ||
index = 0 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
Covered by `tests/unit_tests/document_loaders/test_json_loader.py`
Covered by `tests/unit_tests/document_loaders/test_json_loader.py`
Covered by
tests/unit_tests/document_loaders/test_json_loader.py