Conversation
|
@0xamlab is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @0xamlab, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
|
I independently reproduced #13029 and prepared a local fix before seeing this PR. The production change here matches the minimal fix I tested: remove the parent-ID truthiness guard while retaining the One test-coverage suggestion: the new mixed parentless/leaf tests describe verifying that merging still works, but each passes only Additional edge cases I covered locally are real My local retriever and hierarchical-splitter suites pass together: 62 tests. That result is for my local patch, not this PR's checkout; I have reviewed your diff but have not run your branch's suite. This is community feedback, not a maintainer approval. The investigation and tests were prepared with Perplexity Computer AI assistance. |
|
Thanks @saiprasanth-git — those were exactly the coverage gaps. I added sync + async cases where both siblings merge into the parent while a parentless root is preserved, real |
|
Thanks for signing the CLA, @0xamlab! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
|
Thanks for addressing the requested cases. The added sync/async coverage, splitter-root cases, and mixed-validity validation test cover the gaps I identified. Looks good from my side. |
Fixes #13029
Problem
AutoMergingRetriever.run() and run_async() raised ValueError: The matched leaf documents do not have the required meta field '__parent_id' when a matched document had no parent (e.g. the root document of the hierarchy or any document outside the tree).
The retriever's merge logic already has a pass-through branch for documents without __parent_id (see _try_merge_level), but _check_valid_documents rejected them before they could reach it.
Change
Remove the truthiness check for __parent_id from _check_valid_documents while keeping the presence checks for __level and __block_size (which can legitimately be 0 for the root).
Parentless matched documents are now returned unchanged; normal leaf-to-parent merging remains intact.
Tests
Ran:
All 33 retriever tests pass and formatting/lint checks pass.
This contribution is from Algenta (thyn-ai).