Skip to content

fix(docling): stringify binary_hash in document metadata - #3607

Closed
vedjaw wants to merge 1 commit into
deepset-ai:mainfrom
vedjaw:fix/docling-binary-hash-string-3604
Closed

fix(docling): stringify binary_hash in document metadata#3607
vedjaw wants to merge 1 commit into
deepset-ai:mainfrom
vedjaw:fix/docling-binary-hash-string-3604

Conversation

@vedjaw

@vedjaw vedjaw commented Jul 17, 2026

Copy link
Copy Markdown

Related Issues

Proposed Changes:

DoclingConverter / MetaExtractor previously copied Docling's origin.binary_hash into Haystack document metadata as an integer. That value is an unsigned 64-bit hash, so values greater than 2**63 - 1 break document stores that map numeric metadata to signed 64-bit types (e.g. OpenSearch long).

Following the maintainer suggestion on #3604, binary_hash is now always stored as a string. The conversion is applied recursively in both extract_dl_doc_meta and extract_chunk_meta, so nested occurrences from chunk JSON are covered as well.

This is a breaking metadata-type change for callers that assumed binary_hash was an int.

How did you test it?

  • Added unit tests for oversized binary_hash in document and chunk metadata paths
  • Added a recursive helper test covering nested dicts/lists and None
  • Ran: pytest tests/test_converter.py::TestMetaExtractor tests/test_converter.py::test_stringify_binary_hash_recursively (8 passed)
  • ruff check on the touched files

Notes for the reviewer

Checklist

Made with Cursor

OpenSearch and other stores map numeric metadata to signed 64-bit longs,
so Docling uint64 binary_hash values above 2^63-1 fail indexing. Convert
binary_hash to str in MetaExtractor output.

Fixes deepset-ai#3604

Co-authored-by: Cursor <cursoragent@cursor.com>
@vedjaw
vedjaw requested a review from a team as a code owner July 17, 2026 20:51
@vedjaw
vedjaw requested review from julian-risch and removed request for a team July 17, 2026 20:51
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@HaystackBot

Copy link
Copy Markdown
Contributor

Hi @vedjaw, thanks a lot for your contribution! 🙏

We noticed that the Contributor License Agreement (CLA) check (license/cla) hasn't passed yet, so we've temporarily moved this PR to draft and paused the review assignment.

To get your PR reviewed, please sign the CLA via the link in the license/cla check below (or in the CLA bot comment). As soon as the check turns green, this PR will automatically be marked ready for review again and a reviewer will be re-assigned.

@HaystackBot
HaystackBot removed the request for review from julian-risch July 28, 2026 12:24
@HaystackBot HaystackBot added the cla-pending PR is in draft until the contributor signs the CLA label Jul 28, 2026
@HaystackBot
HaystackBot marked this pull request as draft July 28, 2026 12:24
@HaystackBot

Copy link
Copy Markdown
Contributor

Hi @vedjaw, just a friendly reminder: this PR is still in draft because the Contributor License Agreement (CLA) hasn't been signed yet. We'd love to review your contribution! Please sign the CLA via the link in the license/cla check, and this PR will automatically be marked ready for review.

@anakin87

Copy link
Copy Markdown
Member

CLA never signed, superseded by #3699

@anakin87 anakin87 closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-pending PR is in draft until the contributor signs the CLA integration:docling type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DoclingConverter: binary_hash metadata can exceed signed 64-bit integer range

4 participants