Skip to content

Commit

Permalink
fix #4853 (#4854)
Browse files Browse the repository at this point in the history
  • Loading branch information
catoverdrive authored and danking committed Nov 29, 2018
1 parent 65a9cd2 commit 35b0977
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions hail/python/test/hail/expr/test_expr.py
Expand Up @@ -338,6 +338,12 @@ def test_agg_group_by(self):
for aggregation, expected in tests:
self.assertEqual(t.aggregate(aggregation), expected)

def test_agg_group_by_on_call(self):
t = hl.utils.range_table(10)
t = t.annotate(call = hl.call(0, 0), x = 1)
res = t.aggregate(hl.agg.group_by(t.call, hl.agg.sum(t.x)))
self.assertEqual(res, {hl.Call([0, 0]): 10})

def test_aggregators_with_randomness(self):
t = hl.utils.range_table(10)
res = t.aggregate(agg.filter(hl.rand_bool(0.5), hl.struct(collection=agg.collect(t.idx), sum=agg.sum(t.idx))))
Expand Down
2 changes: 1 addition & 1 deletion hail/src/main/scala/is/hail/expr/ir/Emit.scala
Expand Up @@ -693,7 +693,7 @@ private class Emit(
Code._null,
aggSig.seqOpArgs(0) match {
case _: TBoolean => Code.boxBoolean(key.value[Boolean])
case _: TInt32 => Code.boxInt(key.value[Int])
case _: TInt32 | _: TCall => Code.boxInt(key.value[Int])
case _: TInt64 => Code.boxLong(key.value[Long])
case _: TFloat32 => Code.boxFloat(key.value[Float])
case _: TFloat64 => Code.boxDouble(key.value[Double])
Expand Down

0 comments on commit 35b0977

Please sign in to comment.