Skip to content

Commit 9bae13e

Browse files
authored
[query] Fix randomness handling in StreamAgg (hail-is#14838)
`uses_agg_randomness` is a method, not a property, so we need to call it in the StreamAgg `__init__`, otherwise, we're just passing the bound method object or using it as a boolean. ## Security Assessment - This change has no security impact ### Impact Description Internal API change
1 parent 952ae20 commit 9bae13e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hail/python/hail/ir/ir.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,8 +2261,9 @@ def renderable_bindings(self, i, default_value=None):
22612261
class StreamAgg(IR):
22622262
@typecheck_method(a=IR, value_name=str, body=IR)
22632263
def __init__(self, a, value_name, body):
2264-
a = a.handle_randomness(body.uses_agg_randomness)
2265-
if body.uses_agg_randomness:
2264+
uses_agg_randomness = body.uses_agg_randomness(is_scan=False)
2265+
a = a.handle_randomness(uses_agg_randomness)
2266+
if uses_agg_randomness:
22662267
tup, uid, elt = unpack_uid(a.typ)
22672268
body = AggLet(value_name, elt, body, is_scan=False)
22682269
body = with_split_rng_state(body, uid, is_scan=False)

0 commit comments

Comments
 (0)