Skip to content

Commit

Permalink
[ES|QL] Fixes error in new metric when breakdown is a number (#167018)
Browse files Browse the repository at this point in the history
## Summary

In ES|QL we don't have field formatters. We just have the type of the
field (number/date etc).

If you are in Discover and write a query which returns only one
column/row then the new metric is suggested.

<img width="1990" alt="image"
src="https://github.com/elastic/kibana/assets/17003240/79650d4b-f0c9-476b-b050-617653ccc993">

If for whatever reason the user goes to breakdown and selects the same
number variable (try_new) the chart will fail to render and you will see
in the console an error.

This happens because EC wait the title to be string but here as we don't
have field formatters this is number and fails.
  • Loading branch information
stratoula authored Sep 22, 2023
1 parent e2a7157 commit 884bcb2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const MetricVis = ({
const baseMetric: MetricWNumber = {
value,
valueFormatter: formatPrimaryMetric,
title,
title: String(title),
subtitle,
icon: config.metric?.icon ? getIcon(config.metric?.icon) : undefined,
extra: (
Expand Down

0 comments on commit 884bcb2

Please sign in to comment.