mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[ML] When importing CSV through file data viz, omit empty values (#39524)
CSV cannot distinguish between null and empty string. Empty CSV values in numeric and date fields are better considered as null rather than empty string, as empty strings are rejected by Elasticsearch for these mapping types. For consistency this change omits all empty values from CSV records from the derived JSON document. Fixes #39240
This commit is contained in:
parent
fbcd355f6c
commit
a139020c56
1 changed files with 3 additions and 1 deletions
|
@ -64,7 +64,9 @@ function formatToJson(data, columnNames) {
|
|||
const line = {};
|
||||
for (let c = 0; c < columnNames.length; c++) {
|
||||
const col = columnNames[c];
|
||||
line[col] = data[i][c];
|
||||
if (data[i][c] !== undefined && data[i][c] !== '') {
|
||||
line[col] = data[i][c];
|
||||
}
|
||||
}
|
||||
docArray.push(line);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue