Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
fix: fixes nan output in rca for specific case
Browse files Browse the repository at this point in the history
In rca, if one group has 0 rows and the aggregation is mean,
we can get nan values in the output. This commit fixes that.
  • Loading branch information
kartikay-bagla committed Dec 8, 2021
1 parent c04badb commit 78ad6de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chaos_genius/core/rca/root_cause_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ def _get_waterfall_output_data(

d1_agg = self._grp1_df[self._metric].agg(self._agg)
d2_agg = self._grp2_df[self._metric].agg(self._agg)
d1_agg = 0 if pd.isna(d1_agg) else d1_agg
d2_agg = 0 if pd.isna(d2_agg) else d2_agg
impact = d2_agg - d1_agg
non_overlap_impact = df_subgroups["impact_non_overlap"].sum()

Expand Down

0 comments on commit 78ad6de

Please sign in to comment.