fix(post-processing): handle missing values in cumulative operator (#26429)

This commit is contained in:
Ville Brofeldt
2024-01-09 03:56:19 -08:00
committed by GitHub
parent efdeb9df05
commit ff025b78f3
3 changed files with 20 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ def cum(
"""
columns = columns or {}
df_cum = df.loc[:, columns.keys()]
df_cum = df_cum.fillna(0)
operation = "cum" + operator
if operation not in ALLOWLIST_CUMULATIVE_FUNCTIONS or not hasattr(
df_cum, operation