Skip to content

Commit bbe469f

Browse files
committed
fix(cypher): keep alias-scope fix within surface guard budget (#1391)
1 parent a9040ba commit bbe469f

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

graphistry/compute/gfql/cypher/lowering.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4074,8 +4074,6 @@ def _lower_projection_chain(
40744074
params=params,
40754075
)
40764076
)
4077-
# Row-WHERE is evaluated before WITH/RETURN projection scope trimming, so keep a
4078-
# pre-membership alias set for WHERE validation (e.g. NOT(person=friend) in IC11).
40794077
pre_scope_binding_row_aliases = set(binding_row_aliases)
40804078
binding_row_aliases = _apply_bound_scope_membership(
40814079
binding_row_aliases,
@@ -4106,12 +4104,7 @@ def _lower_projection_chain(
41064104
if not _can_lower_multi_alias_projection_bindings(plan, alias_targets=alias_targets):
41074105
raise _multi_alias_exc
41084106

4109-
allowed_match_aliases = (
4110-
({plan.source_alias} | plan.all_source_aliases | binding_row_aliases)
4111-
if plan.all_source_aliases is not None
4112-
else binding_row_aliases
4113-
)
4114-
where_allowed_match_aliases = allowed_match_aliases | pre_scope_binding_row_aliases
4107+
allowed_match_aliases = ({plan.source_alias} | plan.all_source_aliases | binding_row_aliases) if plan.all_source_aliases is not None else binding_row_aliases
41154108
if plan.all_source_aliases is not None or pre_scope_binding_row_aliases or lowered.row_pre_filters:
41164109
row_steps: List[ASTObject] = [rows(binding_ops=serialize_binding_ops(lowered.query))]
41174110
else:
@@ -4121,7 +4114,7 @@ def _lower_projection_chain(
41214114
lowered=lowered,
41224115
alias_targets=alias_targets,
41234116
active_alias=plan.source_alias,
4124-
allowed_match_aliases=where_allowed_match_aliases or None,
4117+
allowed_match_aliases=(allowed_match_aliases | pre_scope_binding_row_aliases) or None,
41254118
params=params,
41264119
)
41274120

0 commit comments

Comments
 (0)