Allow empty and null key types (#35016)

This commit is contained in:
igoristic 2019-04-16 03:14:41 -07:00 committed by GitHub
parent 2399d4d524
commit 8fde4df6ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { defaultsDeep, isEmpty, uniq, compact } from 'lodash';
import { defaultsDeep, uniq, compact } from 'lodash';
import { callClusterFactory } from '../../../xpack_main';
import {
LOGGING_TAG,
@ -169,9 +169,6 @@ export class BulkUploader {
// convert the raw data to a nested object by taking each payload through
// its formatter, organizing it per-type
const typesNested = rawData.reduce((accum, { type, result }) => {
if (isEmpty(result)) {
return accum;
}
const { type: uploadType, payload: uploadData } = collectorSet.getCollectorByType(type).formatForBulkUpload(result);
return defaultsDeep(accum, { [uploadType]: uploadData });
}, {});