File tree 1 file changed +9
-5
lines changed
hub/src/main/scala/ai/chronon/hub/handlers 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -119,14 +119,18 @@ class TimeSeriesHandler(driftStore: DriftStore) {
119
119
// check if we have a numeric / categorical feature. If the percentile drift series has non-null doubles
120
120
// then we have a numeric feature at hand
121
121
val isNumeric =
122
- tileDriftSeries.percentileDriftSeries.asScala != null && tileDriftSeries.percentileDriftSeries.asScala
123
- .exists(_ != null )
122
+ Option (tileDriftSeries.percentileDriftSeries).exists(series =>
123
+ series.asScala.exists(_ != null ))
124
+
124
125
val lhsList = if (metric == NullMetric ) {
125
- tileDriftSeries.nullRatioChangePercentSeries. asScala
126
+ Option ( tileDriftSeries.nullRatioChangePercentSeries).map(_. asScala).getOrElse( Seq .empty)
126
127
} else {
127
- if (isNumeric) tileDriftSeries.percentileDriftSeries.asScala
128
- else tileDriftSeries.histogramDriftSeries.asScala
128
+ if (isNumeric)
129
+ Option (tileDriftSeries.percentileDriftSeries).map(_.asScala).getOrElse(Seq .empty)
130
+ else
131
+ Option (tileDriftSeries.histogramDriftSeries).map(_.asScala).getOrElse(Seq .empty)
129
132
}
133
+
130
134
val points = lhsList.zip(tileDriftSeries.timestamps.asScala).map {
131
135
case (v, ts) => TimeSeriesPoint (v, ts)
132
136
}
You can’t perform that action at this time.
0 commit comments