From 4f15de7956732cfe8924c5cb693e6afc737decb9 Mon Sep 17 00:00:00 2001 From: Tudor Golubenco Date: Sat, 15 Dec 2018 18:14:08 +0100 Subject: [PATCH] Fix painless script in TSVB (#27173) This is a loose forward-port of #25307, which was rushed in for 6.5. I created this PR to make sure we don't lose the fix. Part of #elastic/beats#8957. --- .../server/lib/vis_data/__tests__/helpers/bucket_transform.js | 2 +- .../metrics/server/lib/vis_data/helpers/bucket_transform.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/bucket_transform.js b/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/bucket_transform.js index e0db2422f80b4..8edb7cd77f603 100644 --- a/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/bucket_transform.js +++ b/src/legacy/core_plugins/metrics/server/lib/vis_data/__tests__/helpers/bucket_transform.js @@ -437,7 +437,7 @@ describe('bucketTransform', () => { }, gap_policy: 'skip', script: { - source: 'params.value > 0 ? params.value : 0', + source: 'params.value > 0.0 ? params.value : 0.0', lang: 'painless' } } diff --git a/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/bucket_transform.js b/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/bucket_transform.js index c487e541beb39..459da1a3d8486 100644 --- a/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/bucket_transform.js +++ b/src/legacy/core_plugins/metrics/server/lib/vis_data/helpers/bucket_transform.js @@ -252,7 +252,7 @@ export default { value: getBucketsPath(bucket.field, metrics), }, script: { - source: 'params.value > 0 ? params.value : 0', + source: 'params.value > 0.0 ? params.value : 0.0', lang: 'painless', }, gap_policy: 'skip', // seems sane