Protect null embeddings - v2.0 (#627)

* Don't emit graph embeddings if there aren't any.

* Don't store graph embeddings in a knowledge store if there's an empty list.

* Translate between Cassandra's 'null' representing an empty list and an
  empty list which is what the surrounding code wants (and stored in the
  first place).

* Avoid emitting empty embedding lists

* Avoid output empty triple lists

* Fix tests
This commit is contained in:
cybermaggedon 2026-02-09 14:57:36 +00:00 committed by GitHub
parent 98827e5561
commit 8574861196
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 88 additions and 91 deletions

View file

@ -73,12 +73,13 @@ class Processor(FlowProcessor):
)
)
r = GraphEmbeddings(
metadata=v.metadata,
entities=entities,
)
if entities:
r = GraphEmbeddings(
metadata=v.metadata,
entities=entities,
)
await flow("output").send(r)
await flow("output").send(r)
except Exception as e:
logger.error("Exception occurred", exc_info=True)