fix(docling): stringify binary_hash in document metadata - #3607
Conversation
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>
|
|
|
Hi @vedjaw, 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 |
|
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 |
|
CLA never signed, superseded by #3699 |
Related Issues
Proposed Changes:
DoclingConverter/MetaExtractorpreviously copied Docling'sorigin.binary_hashinto Haystack document metadata as an integer. That value is an unsigned 64-bit hash, so values greater than2**63 - 1break document stores that map numeric metadata to signed 64-bit types (e.g. OpenSearchlong).Following the maintainer suggestion on #3604,
binary_hashis now always stored as a string. The conversion is applied recursively in bothextract_dl_doc_metaandextract_chunk_meta, so nested occurrences from chunk JSON are covered as well.This is a breaking metadata-type change for callers that assumed
binary_hashwas anint.How did you test it?
binary_hashin document and chunk metadata pathsNonepytest tests/test_converter.py::TestMetaExtractor tests/test_converter.py::test_stringify_binary_hash_recursively(8 passed)ruff checkon the touched filesNotes for the reviewer
binary_hash: str+ major release of the integration).Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.Made with Cursor