diff --git a/piker/accounting/calc.py b/piker/accounting/calc.py index 5919c0d6..ff12c055 100644 --- a/piker/accounting/calc.py +++ b/piker/accounting/calc.py @@ -465,7 +465,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. @@ -480,7 +480,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 @@ -622,7 +622,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. diff --git a/piker/tsp/_anal.py b/piker/tsp/_anal.py index ea78c46a..42c3aa6c 100644 --- a/piker/tsp/_anal.py +++ b/piker/tsp/_anal.py @@ -517,7 +517,7 @@ def with_dts( ''' return df.with_columns([ - pl.col(time_col).shift(1).suffix('_prev'), + pl.col(time_col).shift(1).name.suffix('_prev'), pl.col(time_col).diff().alias('s_diff'), pl.from_epoch(pl.col(time_col)).alias('dt'), ]).with_columns([ @@ -623,7 +623,7 @@ def detect_vlm_gaps( ) -> pl.DataFrame: - vnull: pl.DataFrame = w_dts.filter( + vnull: pl.DataFrame = df.filter( pl.col(col) == 0 ) return vnull