diff --git a/app/routers_v2/decisions.py b/app/routers_v2/decisions.py index f8f66bd..560f2e7 100644 --- a/app/routers_v2/decisions.py +++ b/app/routers_v2/decisions.py @@ -170,11 +170,15 @@ async def get_decisions_for_rest( this_val.append(this_card.id if this_card is not None else -1) this_val.append(1 if x.is_start else 0) if not native_rest: - this_line = StratPlay.select( - StratPlay.pitcher, - StratPlay.game, - fn.SUM(StratPlay.outs).alias("sum_outs"), - ).where((StratPlay.game == x.game) & (StratPlay.pitcher == x.pitcher)) + this_line = ( + StratPlay.select( + StratPlay.pitcher, + StratPlay.game, + fn.SUM(StratPlay.outs).alias("sum_outs"), + ) + .where((StratPlay.game == x.game) & (StratPlay.pitcher == x.pitcher)) + .group_by(StratPlay.pitcher, StratPlay.game) + ) logging.info(f"this_line: {this_line[0]}") if this_line[0].sum_outs is None: this_val.append(0.0)