From 2baf21c5e1ce5e241400ae6f0770e1f4d4169e0f Mon Sep 17 00:00:00 2001 From: cybermaggedon Date: Thu, 13 Nov 2025 16:29:40 +0000 Subject: [PATCH] Collection deletion batch error fixed (#559) Collection deletion caused a batch error, this reduces batch size on deletion --- trustgraph-flow/trustgraph/direct/cassandra_kg.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/trustgraph-flow/trustgraph/direct/cassandra_kg.py b/trustgraph-flow/trustgraph/direct/cassandra_kg.py index dc0f2c2b..116abe02 100644 --- a/trustgraph-flow/trustgraph/direct/cassandra_kg.py +++ b/trustgraph-flow/trustgraph/direct/cassandra_kg.py @@ -334,13 +334,14 @@ class KnowledgeGraph: count += 1 - # Execute batch every 100 triples to avoid oversized batches - if count % 100 == 0: + # Execute batch every 25 triples to avoid oversized batches + # (Each triple adds ~4 statements, so 25 triples = ~100 statements) + if count % 25 == 0: self.session.execute(batch) batch = BatchStatement() # Execute remaining deletions - if count % 100 != 0: + if count % 25 != 0: self.session.execute(batch) # Step 3: Delete collection metadata