Skip to content

Commit

Permalink
[StatsFetch] Ignore bad decodes
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianfr committed Feb 1, 2024
1 parent 9bee3dc commit ac73f57
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions online/src/main/scala/ai/chronon/online/Fetcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,16 @@ class Fetcher(val kvStore: KVStore,
rawResponses.map { responseFuture =>
val convertedValue = responseFuture
.flatMap { response =>
response.values.get.map {
case (key, v) =>
key ->
Map(
"millis" -> response.millis.asInstanceOf[AnyRef],
"value" -> StatsGenerator.SeriesFinalizer(key, v)
).asJava
}
response.values
.getOrElse(Map.empty[String, AnyRef])
.map {
case (key, v) =>
key ->
Map(
"millis" -> response.millis.asInstanceOf[AnyRef],
"value" -> StatsGenerator.SeriesFinalizer(key, v)
).asJava
}
}
.groupBy(_._1)
.mapValues(_.map(_._2).toList.asJava)
Expand Down

0 comments on commit ac73f57

Please sign in to comment.