This repository was archived by the owner on Jun 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,11 @@ def flake_aggregates_with_percentage(
42
42
merged_results : pl .DataFrame = pl .concat ([past_aggregates , curr_aggregates ])
43
43
44
44
merged_results = merged_results .with_columns (
45
- pl .all ().pct_change ().fill_nan (0 ).name .suffix ("_percent_change" )
45
+ pl .all ()
46
+ .pct_change ()
47
+ .replace ([float ("inf" ), float ("-inf" )], None )
48
+ .fill_nan (0 )
49
+ .name .suffix ("_percent_change" )
46
50
)
47
51
aggregates = merged_results .row (1 , named = True )
48
52
Original file line number Diff line number Diff line change @@ -71,7 +71,11 @@ def test_results_aggregates_with_percentage(
71
71
# with_columns upserts the new columns, so if the name already exists it get overwritten
72
72
# otherwise it's just added
73
73
merged_results = merged_results .with_columns (
74
- pl .all ().pct_change ().fill_nan (0 ).name .suffix ("_percent_change" )
74
+ pl .all ()
75
+ .pct_change ()
76
+ .replace ([float ("inf" ), float ("-inf" )], None )
77
+ .fill_nan (0 )
78
+ .name .suffix ("_percent_change" )
75
79
)
76
80
aggregates = merged_results .row (1 , named = True )
77
81
You can’t perform that action at this time.
0 commit comments