Skip to content

Commit ebe38bc

Browse files
committed
Handle null values
1 parent 491cab5 commit ebe38bc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

frontend/src/lib/components/charts/FeaturesLineChart.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { formatDate, formatValue } from '$lib/util/format';
99
import { Badge } from '../ui/badge';
1010
import { isMacOS } from '$src/lib/util/browser';
11+
import { NULL_VALUE } from '$src/lib/constants/common';
1112
1213
type LineChartProps = ComponentProps<typeof LineChart>;
1314
type BrushProps = ComponentProps<Brush>;
@@ -38,7 +39,7 @@
3839
data: d.points.map((p) => {
3940
return {
4041
date: new Date(p.ts),
41-
value: p.value
42+
value: p.value === NULL_VALUE ? null : p.value
4243
};
4344
}),
4445
color: colorScale(d.feature)

frontend/src/lib/constants/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Maps to `Constants.magicNullDouble` on server - https://github.com/zipline-ai/chronon/blob/main/api/src/main/scala/ai/chronon/api/Constants.scala#L87
2+
export const NULL_VALUE = -27980863399423856;

0 commit comments

Comments
 (0)