docling icon indicating copy to clipboard operation
docling copied to clipboard

fix: Fixes and tests for StopIteration on .convert()

Open cau-git opened this issue 1 year ago • 3 comments

Checklist:

  • [ ] Documentation has been updated, if necessary.
  • [ ] Examples have been added, if necessary.
  • [x] Tests have been added, if necessary.

cau-git avatar Nov 25 '24 13:11 cau-git

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • [X] title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

mergify[bot] avatar Nov 25 '24 13:11 mergify[bot]

I also think we should not touch the return type, since the function have an explicit argument raises_on_error.

But it is still unclear to me what could/should be the return value when raises_on_error=False and the document is invalid? Would a failed ConversionResult with the proper status, and the default _EMPTY_DOCLING_DOC be a good choice?

dolfim-ibm avatar Nov 25 '24 16:11 dolfim-ibm

I also think we should not touch the return type, since the function have an explicit argument raises_on_error.

But it is still unclear to me what could/should be the return value when raises_on_error=False and the document is invalid? Would a failed ConversionResult with the proper status, and the default _EMPTY_DOCLING_DOC be a good choice?

Yes and we can introduce a new ConversionStatus.INVALID for that case.

vagenas avatar Nov 26 '24 08:11 vagenas

We must agree on the naming, instead of UNSUPPORTED.

DROPPED
DISCARDED
SKIPPED # favourite

and add a reason that explains properly what went wrong as an ErrorItem in the errors log of ConversionResult.

cau-git avatar Dec 02 '24 09:12 cau-git