Skip to content

Commit

Permalink
[8.7] [ML] Allow splitting by field of ip type for Change point det…
Browse files Browse the repository at this point in the history
…ection (#151022) (#151144)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[ML] Allow splitting by field of `ip` type for Change point detection
(#151022)](#151022)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-14T14:33:55Z","message":"[ML]
Allow splitting by field of `ip` type for Change point detection
(#151022)\n\n## Summary\r\n\r\nFollow-up for
https://github.com/elastic/kibana/pull/150308\r\n\r\nResolves
https://github.com/elastic/kibana/issues/145703\r\n\r\nAllows splitting
by field of `ip` type for Change point
detection","sha":"12efa3584743e67fc474dc57edbbb6d2b6182b5a","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":[":ml","release_note:skip","Team:ML","Feature:ML/AIOps","v8.7.0","v8.8.0"],"number":151022,"url":"https://github.com/elastic/kibana/pull/151022","mergeCommit":{"message":"[ML]
Allow splitting by field of `ip` type for Change point detection
(#151022)\n\n## Summary\r\n\r\nFollow-up for
https://github.com/elastic/kibana/pull/150308\r\n\r\nResolves
https://github.com/elastic/kibana/issues/145703\r\n\r\nAllows splitting
by field of `ip` type for Change point
detection","sha":"12efa3584743e67fc474dc57edbbb6d2b6182b5a"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151022","number":151022,"mergeCommit":{"message":"[ML]
Allow splitting by field of `ip` type for Change point detection
(#151022)\n\n## Summary\r\n\r\nFollow-up for
https://github.com/elastic/kibana/pull/150308\r\n\r\nResolves
https://github.com/elastic/kibana/issues/145703\r\n\r\nAllows splitting
by field of `ip` type for Change point
detection","sha":"12efa3584743e67fc474dc57edbbb6d2b6182b5a"}}]}]
BACKPORT-->

Co-authored-by: Dima Arnautov <[email protected]>
  • Loading branch information
kibanamachine and darnautov authored Feb 14, 2023
1 parent 601e718 commit 238244e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { Filter, Query } from '@kbn/es-query';
import { usePageUrlState } from '@kbn/ml-url-state';
import { useTimefilter, useTimeRangeUpdates } from '@kbn/ml-date-picker';
import moment from 'moment';
import { ES_FIELD_TYPES } from '@kbn/field-types';
import { DEFAULT_AGG_FUNCTION } from './constants';
import { useSplitFieldCardinality } from './use_split_field_cardinality';
import {
Expand Down Expand Up @@ -163,7 +164,9 @@ export const ChangePointDetectionContextProvider: FC = ({ children }) => {
({ aggregatable, esTypes, displayName }) =>
aggregatable &&
esTypes &&
esTypes.includes('keyword') &&
esTypes.some((el) =>
[ES_FIELD_TYPES.KEYWORD, ES_FIELD_TYPES.IP].includes(el as ES_FIELD_TYPES)
) &&
!['_id', '_index'].includes(displayName)
);
}, [dataView]);
Expand Down

0 comments on commit 238244e

Please sign in to comment.