Remove None guard and test — type system guarantees document is not None
This commit is contained in:
parent
256fd66b46
commit
25b0a155b0
2 changed files with 0 additions and 10 deletions
|
|
@ -177,7 +177,4 @@ class DoclingLocalChunker(DocumentChunker):
|
||||||
Returns:
|
Returns:
|
||||||
List of Chunk containing content and structured metadata.
|
List of Chunk containing content and structured metadata.
|
||||||
"""
|
"""
|
||||||
if document is None:
|
|
||||||
return []
|
|
||||||
|
|
||||||
return await asyncio.to_thread(self._chunk_sync, document)
|
return await asyncio.to_thread(self._chunk_sync, document)
|
||||||
|
|
|
||||||
|
|
@ -55,13 +55,6 @@ async def test_local_chunker(qa_corpus: list[dict[str, str]]):
|
||||||
assert abs(total_tokens - original_tokens) <= original_tokens * 0.1
|
assert abs(total_tokens - original_tokens) <= original_tokens * 0.1
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
async def test_local_chunker_none_document():
|
|
||||||
"""Test DoclingLocalChunker returns empty list for None document."""
|
|
||||||
chunker = DoclingLocalChunker()
|
|
||||||
assert await chunker.chunk(None) == []
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_local_chunker_custom_config():
|
async def test_local_chunker_custom_config():
|
||||||
"""Test DoclingLocalChunker with custom configuration."""
|
"""Test DoclingLocalChunker with custom configuration."""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue