mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ML] Fix Transform runtime mappings retain original definition when cloning (#95436)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
b1525f0af7
commit
f061303282
2 changed files with 7 additions and 5 deletions
|
@ -45,6 +45,7 @@ export const destSchema = schema.object({
|
|||
export const pivotSchema = schema.object({
|
||||
group_by: schema.any(),
|
||||
aggregations: schema.any(),
|
||||
max_page_search_size: schema.maybe(schema.number()),
|
||||
});
|
||||
|
||||
export const latestFunctionSchema = schema.object({
|
||||
|
|
|
@ -84,11 +84,6 @@ export function getCombinedRuntimeMappings(
|
|||
): StepDefineExposedState['runtimeMappings'] | undefined {
|
||||
let combinedRuntimeMappings = {};
|
||||
|
||||
// Use runtime field mappings defined inline from API
|
||||
if (isPopulatedObject(runtimeMappings)) {
|
||||
combinedRuntimeMappings = { ...combinedRuntimeMappings, ...runtimeMappings };
|
||||
}
|
||||
|
||||
// And runtime field mappings defined by index pattern
|
||||
if (isIndexPattern(indexPattern)) {
|
||||
const computedFields = indexPattern.getComputedFields();
|
||||
|
@ -100,6 +95,12 @@ export function getCombinedRuntimeMappings(
|
|||
}
|
||||
}
|
||||
|
||||
// Use runtime field mappings defined inline from API
|
||||
// and override fields with same name from index pattern
|
||||
if (isPopulatedObject(runtimeMappings)) {
|
||||
combinedRuntimeMappings = { ...combinedRuntimeMappings, ...runtimeMappings };
|
||||
}
|
||||
|
||||
if (isPopulatedObject<StepDefineExposedState['runtimeMappings']>(combinedRuntimeMappings)) {
|
||||
return combinedRuntimeMappings;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue