prevent crash when semantic_identifier is None (#201)

This is a workaround around intermittent issues where sementic_identifier becomes None for some reason. It usually recovers when documents are rescraped.

Obviously, we do not yet understand the issue and are interested in a better solution.
This commit is contained in:
jabdoa2 2023-07-29 21:37:02 +02:00 committed by GitHub
parent 17e2008027
commit 878d4e367f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ def chunks_to_search_docs(chunks: list[InferenceChunk] | None) -> list[SearchDoc
blurb=chunk.blurb,
source_type=chunk.source_type,
)
for chunk in chunks
for chunk in chunks if chunk.semantic_identifier
]
if chunks
else []