Skip to content

[ML] Transforms: Support for terms agg in pivot configurations. - #123634

Merged
walterra merged 7 commits into
elastic:mainfrom
walterra:ml-transform-terms-agg
Jan 27, 2022
Merged

walterra merged 7 commits into
elastic:mainfrom
walterra:ml-transform-terms-agg

Conversation

@walterra

@walterra walterra commented Jan 24, 2022 •

Copy link
Copy Markdown
Contributor

Summary

Part of #123459.

Adds support for the terms agg for transform pivot configurations.

Checklist

@walterra walterra mentioned this pull request Jan 25, 2022
17 of 32 tasks
@walterra
walterra marked this pull request as ready for review January 25, 2022 08:11
@walterra
walterra requested a review from a team as a code owner January 25, 2022 08:11
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

}
isInvalid={!validSize}
>
<EuiFieldText defaultValue={sizeText} onChange={(e) => updateSize(e.target.value)} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

size is a number type, shall we use https://elastic.github.io/eui/#/forms/form-controls#number-field control instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember we intentionally went with the text field in other cases too because we had problems in the past with custom validations. So for consistency I went with the text based one here again. See the input for 'Maximum page search size' for example.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found EuiFieldNumber in

. But in case you still experience issues with custom validation we can stick to the text field

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth another look at EuiFieldNumber as currently it silently accepts fractional values (rounding down to nearest integer):

image

@walterra walterra Jan 26, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the additional feedback, I switched to EuiFieldNumber in 4878e18. Looking into this, I noticed the form validation approach I copied over from the percentiles variant was a bit flawed. I fixed that in the same commit. For both percentiles and size it's now validating the input string and keeping that as separate state. Previously, similar like the screenshot above with a float not triggering an error, for percentiles it also wouldn't show an error but just fall back to the default value when applied.

const sampleDoc = sample(docs) ?? {};
const missingMappings = difference(Object.keys(sampleDoc), Object.keys(populatedProperties));
// Identify missing mappings
const missingMappings = difference(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grid isn't inferring the type of the value correctly - it thinks it's a string, so left aligns the cell contents, and gives the alphabetical sort options (note sort isn't working on nested fields but I will raise a separate issue for that).

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to address this as part of #123796 as even if the type for the terms agg columns is correctly set to numeric it still won't be sorted correctly as the column name will contain a dot.

@walterra walterra mentioned this pull request Jan 26, 2022
13 tasks done

@peteharverson peteharverson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested latest changes and LGTM.
We should look at the issues with the type and sorting of the preview columns in #123796.

@walterra

Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@darnautov darnautov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kibana-ci

Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
transform 364.7KB 365.8KB +1.1KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @walterra

@walterra
walterra merged commit b8b7edf into elastic:main Jan 27, 2022
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Jan 27, 2022
@walterra
walterra deleted the ml-transform-terms-agg branch January 27, 2022 10:57
@peteharverson peteharverson added the release_note:feature Makes this part of the condensed release notes label Feb 2, 2022
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
…tic#123634)

Adds support for the terms agg for transform pivot configurations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Transforms Transforms :ml release_note:feature Makes this part of the condensed release notes v8.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants