Skip to content

Commit 4def294

Browse files
authored
fix(hql): handle TraversalValue::Empty in DROP operations (#673)
## Summary This PR integrates the fix from #670 into the `arena-implementation` branch. It resolves runtime errors when attempting to DROP non-existent nodes, edges, or vectors. ## Problem Queries attempting to drop non-existent items failed with: ``` Conversion error: Incorrect Type: Empty ``` This occurred because `drop_traversal` did not handle `TraversalValue::Empty` returned when querying for non-existent items. ## Solution Added `TraversalValue::Empty => Ok(())` case in the match statement of `drop_traversal` in `helix-db/src/helix_engine/traversal_core/ops/util/drop.rs:51`. This treats empty traversals as successful no-ops, making DROP operations idempotent. ## Testing - ✅ `cargo check` passes with no errors - ✅ All 109 `helix_engine` tests pass, including all DROP-related tests ## Related - Integrates fix from PR #670 - No changes needed to helixc generator - the fix automatically applies to generated code Co-Authored-By: ishaksebsib
2 parents b146b83 + 66271c0 commit 4def294

File tree

1 file changed

+1
-0
lines changed
  • helix-db/src/helix_engine/traversal_core/ops/util

1 file changed

+1
-0
lines changed

helix-db/src/helix_engine/traversal_core/ops/util/drop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ where
4848
Err(e) => Err(e),
4949
}
5050
}
51+
TraversalValue::Empty => Ok(()),
5152
_ => Err(GraphError::ConversionError(format!(
5253
"Incorrect Type: {item:?}"
5354
))),

0 commit comments

Comments
 (0)