From 62f27bf50961f26215598572eebd5558ff9de416 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 27 Sep 2025 12:24:11 -0400 Subject: [PATCH] `polars.cumsum()` is now `.cum_sum()` --- piker/accounting/calc.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/piker/accounting/calc.py b/piker/accounting/calc.py index aabb3031..f57a2b3b 100644 --- a/piker/accounting/calc.py +++ b/piker/accounting/calc.py @@ -493,7 +493,7 @@ def ledger_to_dfs( df = dfs[key] = ldf.with_columns([ - pl.cumsum('size').alias('cumsize'), + pl.cum_sum('size').alias('cumsize'), # amount of source asset "sent" (via buy txns in # the market) to acquire the dst asset, PER txn. @@ -508,7 +508,7 @@ def ledger_to_dfs( ]).with_columns([ # rolling balance in src asset units - (pl.col('dst_bot').cumsum() * -1).alias('src_balance'), + (pl.col('dst_bot').cum_sum() * -1).alias('src_balance'), # "position operation type" in terms of increasing the # amount in the dst asset (entering) or decreasing the @@ -650,7 +650,7 @@ def ledger_to_dfs( # cost that was included in the least-recently # entered txn that is still part of the current CSi # set. - # => we look up the cost-per-unit cumsum and apply + # => we look up the cost-per-unit cum_sum and apply # if over the current txn size (by multiplication) # and then reverse that previusly applied cost on # the txn_cost for this record.