fix: Fixes and tests for StopIteration on .convert()
Checklist:
- [ ] Documentation has been updated, if necessary.
- [ ] Examples have been added, if necessary.
- [x] Tests have been added, if necessary.
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)(?:\(.+\))?:
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?
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=Falseand the document is invalid? Would a failedConversionResultwith the proper status, and the default_EMPTY_DOCLING_DOCbe a good choice?
Yes and we can introduce a new ConversionStatus.INVALID for that case.
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.