MarkItDownConverter drops ByteStream metadata other than file_path

Aperta
#4,267 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@subrahmanyahegde24 ci sta già lavorando.

Dal 16/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Open haystack_integrations/components/converters/markitdown/__init__.py and read the run method where each ByteStream's meta is turned into the output Document's meta — today only file_path is copied, then normalized by store_full_path and merged with the user-supplied meta. Start from the reproducer in the issue to see the loss, then check the converter's existing tests under test/.../markitdown to mirror their parameterized style. Done means source meta (author, language) survives, file_path is still normalized, and explicit run meta still wins; the four new regressions and the existing 17 unit tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

integration:markitdown P2

A local text ByteStream carrying author and language metadata loses both during conversion. Explicit metadata passed to run is kept, but the source metadata is not merged into the Document.

from haystack.dataclasses import ByteStream
from haystack_integrations.components.converters.markitdown import MarkItDownConverter

source = ByteStream(
    data=b"Hello local text",
    mime_type="text/plain",
    meta={"file_path": "/original/input.txt", "author": "Alice", "language": "en"},
)
result = MarkItDownConverter().run(sources=[source])
print(result["documents"][0].meta)
# Actual: {"file_path": "input.txt"}

Expected: retain author and language, normalize file_path according to store_full_path, and let explicit run metadata override source values.

Checked on main at d88734f71069612b119c589372cbc6f767a7f76a with Python 3.12.0, MarkItDown 0.1.9 and Haystack 3.4.1. Four real local text conversions reproduce the loss. A fresh check confirms that the current main converter still copies only file_path from ByteStream metadata. A small local candidate copies source.meta before the existing path normalization and user metadata merge. It preserves the source mapping and existing override precedence.

Four parameterized regressions fail on main and pass with the candidate. The unit suite passes 17 tests, with 1 integration test deselected. Ruff and mypy pass. No external conversion service was used.

Would this be welcome as a focused fix? If so, could you assign it to @SuhrudhC? I have not opened a PR. The original converter PR #3045 was checked, including its review discussion, and the proposed change preserves its direct source handling.

This report and local candidate were prepared with Codex, which ran the checks above. No human code review is claimed.

Lingua principale
Python
Stelle
212
Fork
396
Merge medio
2g 9h
PR unite (30g)
95

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di deepset-ai/haystack-core-integrations

Tutte le issue di deepset-ai/haystack-core-integrations

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.