Elastic: Fix parsing for millisecond number timestamps (#20290)

* Stop parsing 'field'

* Remove time field from query for docs queries

* Test refactor to test all versions

* Fix tests
This commit is contained in:
Andrej Ocenas
2019-12-04 14:43:43 +01:00
committed by David
parent c43aa3485c
commit 4c9cb415ec
6 changed files with 471 additions and 569 deletions

View File

@@ -58,7 +58,7 @@ describe('Apending DataFrame', () => {
]);
// Add a time value that has an array type
frame.add({ time: [300] });
frame.add({ time: 300 });
expect(frame.toArray()).toEqual([
{ time: 100, name: 'a', value: 1, value2: null }, // 1
{ time: 200, name: 'BB', value: 20, value2: null }, // 2

View File

@@ -231,11 +231,6 @@ export class MutableDataFrame<T = any> implements DataFrame, MutableVector<T> {
field.parse = makeFieldParser(val, field);
}
val = field.parse(val);
} else if (field.type === FieldType.time && isArray(val)) {
if (!field.parse) {
field.parse = (val: any[]) => val[0] || undefined;
}
val = field.parse(val);
}
if (val === undefined) {