Skip to content

Commit 3a369dd

Browse files
lmeyerovclaude
andcommitted
fix(chain): correct multi-hop detection for hops=None from JSON
The check `getattr(op, 'hops', 1) != 1` incorrectly detected multi-hop when hops was None (from JSON deserialization), since None != 1 is True. Fixed to explicitly check for non-None and non-1 values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b8d1e8e commit 3a369dd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎graphistry/compute/chain.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def combine_steps(
225225
# Multi-hop edges span multiple nodes, so simple endpoint filtering doesn't work
226226
has_multihop = any(
227227
isinstance(op, ASTEdge) and (
228-
getattr(op, 'hops', 1) != 1 or
228+
(getattr(op, 'hops', None) is not None and getattr(op, 'hops', None) != 1) or
229229
getattr(op, 'min_hops', None) is not None or
230230
getattr(op, 'max_hops', None) is not None or
231231
getattr(op, 'to_fixed_point', False)

0 commit comments

Comments
 (0)