Skip to content

Commit b343a28

Browse files
committed
fixing merge conflicts
1 parent d49b0ad commit b343a28

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

x-pack/plugins/ml/public/application/services/new_job_capabilities_service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
import { ml } from './ml_api_service';
2121
import { getIndexPatternAndSavedSearch } from '../util/index_utils';
2222

23-
// called in the angular routing resolve block to initialize the
23+
// called in the routing resolve block to initialize the
2424
// newJobCapsService with the currently selected index pattern
2525
export function loadNewJobCapabilities(
2626
indexPatternId: string,

x-pack/plugins/ml/server/models/data_visualizer/data_visualizer.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
import { ILegacyScopedClusterClient } from 'kibana/server';
8-
import { LegacyAPICaller } from 'kibana/server';
98
import _ from 'lodash';
109
import { KBN_FIELD_TYPES } from '../../../../../../src/plugins/data/server';
1110
import { ML_JOB_FIELD_TYPES } from '../../../common/constants/field_types';
@@ -181,7 +180,7 @@ type BatchStats =
181180
| FieldExamples;
182181

183182
const getAggIntervals = async (
184-
callAsCurrentUser: LegacyAPICaller,
183+
{ callAsCurrentUser }: ILegacyScopedClusterClient,
185184
indexPatternTitle: string,
186185
query: any,
187186
fields: HistogramField[],
@@ -239,14 +238,15 @@ const getAggIntervals = async (
239238

240239
// export for re-use by transforms plugin
241240
export const getHistogramsForFields = async (
242-
callAsCurrentUser: LegacyAPICaller,
241+
mlClusterClient: ILegacyScopedClusterClient,
243242
indexPatternTitle: string,
244243
query: any,
245244
fields: HistogramField[],
246245
samplerShardSize: number
247246
) => {
247+
const { callAsCurrentUser } = mlClusterClient;
248248
const aggIntervals = await getAggIntervals(
249-
callAsCurrentUser,
249+
mlClusterClient,
250250
indexPatternTitle,
251251
query,
252252
fields,
@@ -349,11 +349,12 @@ export const getHistogramsForFields = async (
349349
};
350350

351351
export class DataVisualizer {
352-
callAsCurrentUser: LegacyAPICaller;
353-
354-
constructor(callAsCurrentUser: LegacyAPICaller) {
355-
this.callAsCurrentUser = callAsCurrentUser;
352+
private _mlClusterClient: ILegacyScopedClusterClient;
353+
private _callAsCurrentUser: ILegacyScopedClusterClient['callAsCurrentUser'];
356354

355+
constructor(mlClusterClient: ILegacyScopedClusterClient) {
356+
this._callAsCurrentUser = mlClusterClient.callAsCurrentUser;
357+
this._mlClusterClient = mlClusterClient;
357358
}
358359

359360
// Obtains overall stats on the fields in the supplied index pattern, returning an object
@@ -449,7 +450,7 @@ export class DataVisualizer {
449450
samplerShardSize: number
450451
): Promise<any> {
451452
return await getHistogramsForFields(
452-
this.callAsCurrentUser,
453+
this._mlClusterClient,
453454
indexPatternTitle,
454455
query,
455456
fields,

x-pack/plugins/ml/server/routes/data_visualizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function getHistogramsForFields(
7373
fields: HistogramField[],
7474
samplerShardSize: number
7575
) {
76-
const dv = new DataVisualizer(context.ml!.mlClient.callAsCurrentUser);
76+
const dv = new DataVisualizer(context.ml!.mlClient);
7777
return dv.getHistogramsForFields(indexPatternTitle, query, fields, samplerShardSize);
7878
}
7979

x-pack/plugins/transform/server/routes/api/field_histograms.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function registerFieldHistogramsRoutes({ router, license }: RouteDependen
3434

3535
try {
3636
const resp = await getHistogramsForFields(
37-
ctx.transform!.dataClient.callAsCurrentUser,
37+
ctx.transform!.dataClient,
3838
indexPatternTitle,
3939
query,
4040
fields,

0 commit comments

Comments
 (0)