Browse Source

fix(adv-analysis): Assign score_delta default value (#57813)

We aren't handling the case for removed spans properly so the
`score_delta` value isn't being set before evaluation. Set a default to
0 for now because we're not showing removed spans currently.

Fixes SENTRY-16CE
Nar Saynorath 1 year ago
parent
commit
3179ba56e9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/sentry/api/helpers/span_analysis.py

+ 1 - 0
src/sentry/api/helpers/span_analysis.py

@@ -57,6 +57,7 @@ def span_analysis(data: List[Row]):
         row1 = span_data_p0.get(key)
         row2 = span_data_p1.get(key)
         new_span = False
+        score_delta = 0.0
 
         if row1 and row2:
             score_delta = row2["score"] - row1["score"]