-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Add better UI support for runtime fields Transforms #90363
Conversation
I tried to clone the job When I start cloning, the source table correctly shows the runtime fields. However, the preview doesn't return any results. When I copy the preview configuration using the copy-to-clipboard button, it's missing the runtime fields config:
However, I can move on in the wizard and create the job, it gets cloned including the runtime field settings successfully: |
Testing using an index pattern for which I've set up two runtime fields, |
...analytics/pages/analytics_creation/components/configuration_step/configuration_step_form.tsx
Outdated
Show resolved
Hide resolved
...lugins/transform/public/app/sections/create_transform/components/step_define/common/types.ts
Outdated
Show resolved
Hide resolved
Thanks for testing. The issue with the preview as well as copy to console should be fixed in the latest changes.
There's currently an issue with showing min/max aggregation for these runtime fields which is being tracked here elastic/elasticsearch#68516 |
unsupportedRuntimeFields: | ||
unsupportedRuntimeFields.length > 5 | ||
? unsupportedRuntimeFields.slice(0, 5).join(', ') | ||
: unsupportedRuntimeFields.join(', '), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need in this check, slice
doesn't add extra values to an array
unsupportedRuntimeFields: | |
unsupportedRuntimeFields.length > 5 | |
? unsupportedRuntimeFields.slice(0, 5).join(', ') | |
: unsupportedRuntimeFields.join(', '), | |
unsupportedRuntimeFields: unsupportedRuntimeFields.slice(0, 5).join(', ') | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 7b91ae0
values={{ | ||
runtimeFieldsCount: unsupportedRuntimeFields.length, | ||
extraCountMsg: | ||
unsupportedRuntimeFields.length - 5 > 0 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should avoid magic numbers, worth creating a constant const maxRuntimeFieldsDisplayCount = 5;
or something like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated here 7b91ae0
<EuiCallOut size="s" color="warning"> | ||
<FormattedMessage | ||
id="xpack.ml.dataframe.analytics.create.unsupportedRuntimeFieldsCallout" | ||
defaultMessage="The runtime {runtimeFieldsCount, plural, one {field} other {fields}} {unsupportedRuntimeFields} {extraCountMsg} are not supported for analysis." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, in case {extraCountMsg}
is empty, the sentence ends up with 2 spaces before are not supported for analysis
string. I think and {count} more
message should take care of adding a space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</EuiText> | ||
<EuiSpacer size="s" /> | ||
<EuiButton | ||
style={{ width: 'fit-content' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't break the layout, let's keep it as is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is now sorted alphabetically here 7b91ae0 |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
💔 Backport failed❌ 7.x: Commit could not be cherrypicked due to conflicts To backport manually, check out the target branch and run: |
* master: (157 commits) [DOCS] Adds machine learning to the security section of alerting (elastic#91501) [Uptime] Ping list step screenshot caption formatting (elastic#91403) [Vislib] Use timestamp on brush event instead of iso dates (elastic#91483) [Application Usage] Remove deprecated & unused legacy.appChanged API (elastic#91464) Migrate logstash, monitoring, url_drilldowns, xpack_legacy to ts projects (elastic#91194) [APM] Wrap Elasticsearch client errors (elastic#91125) [APM] Fix optimize-tsconfig script (elastic#91487) [Discover][docs] Add searchFieldsFromSource description (elastic#90980) Adds support for 'ip' data type (elastic#85087) [Detection Rules] Add updates from 7.11.2 rules (elastic#91553) [SECURITY SOLUTION] Eql in timeline (elastic#90816) [APM] Correlations Beta (elastic#86477) (elastic#89952) [Security Solutions][Detection Engine] Adds a warning banner when the alerts data has not been migrated yet. (elastic#90258) [Security Solution] [Timeline] Endpoint row renderers (2nd batch) (elastic#91446) skip flaky suite (elastic#91450) skip flaky suite (elastic#91592) [Security Solution][Endpoint][Admin] Endpoint Details UX Enhancements (elastic#90870) [ML] Add better UI support for runtime fields Transforms (elastic#90363) [Security Solution] [Detections] Replace 'partial failure' with 'warning' for rule statuses (elastic#91167) [Security Solution][Detections] Adds Indicator path config for indicator match rules (elastic#91260) ...
* [ML] Add RT support for transforms from index pattern * [ML] Add support for cloned transform from api * [ML] Add support for runtime pivot * [ML] Add support for api created runtime * [ML] Add preview for expanded row * [ML] Add runtime fields to dropdown options * [ML] Add runtime fields to latest * [ML] Fix duplicate columns * [ML] Update types and test * [ML] Add runtime mappings to index pattern on creation * [ML] Add callout to show unsupported fields in dfa * [ML] Update types to RuntimeField * [ML] Fix runtime fields, remove runtime mappings, fix copy to console * [ML] Fix incompatible kbn field type * [ML] Add advanced mappings editor * [ML] Add support for filter terms agg control * [ML] Fix jest tests hanging * [ML] Fix translations * [ML] Fix over-sized buttons for filter range * [ML] Update runtime mappings schema * [ML] Update runtime mappings schema * [ML] Use isRecord for object checks * [ML] Fix and more message * [ML] Update schema to correctly match types * [ML] Update schema to correctly match types * [ML] Fix pivot duplicates * [ML] Rename isRecord to isPopulatedObject * [ML] Remove fit-content * [ML] Update runtime field type to prevent potential conflicts * Revert "[ML] Remove fit-content" This reverts commit 76c9c79 * [ML] Remove misc comment * [ML] Fix missing typeof * [ML] Add sorts and constants * [ML] Add i18n to includedFields description * [ML] fix imports * [ML] Only pass runtime mappings if it's latest * [ML] Fix functional tests
…1636) * [ML] Add RT support for transforms from index pattern * [ML] Add support for cloned transform from api * [ML] Add support for runtime pivot * [ML] Add support for api created runtime * [ML] Add preview for expanded row * [ML] Add runtime fields to dropdown options * [ML] Add runtime fields to latest * [ML] Fix duplicate columns * [ML] Update types and test * [ML] Add runtime mappings to index pattern on creation * [ML] Add callout to show unsupported fields in dfa * [ML] Update types to RuntimeField * [ML] Fix runtime fields, remove runtime mappings, fix copy to console * [ML] Fix incompatible kbn field type * [ML] Add advanced mappings editor * [ML] Add support for filter terms agg control * [ML] Fix jest tests hanging * [ML] Fix translations * [ML] Fix over-sized buttons for filter range * [ML] Update runtime mappings schema * [ML] Update runtime mappings schema * [ML] Use isRecord for object checks * [ML] Fix and more message * [ML] Update schema to correctly match types * [ML] Update schema to correctly match types * [ML] Fix pivot duplicates * [ML] Rename isRecord to isPopulatedObject * [ML] Remove fit-content * [ML] Update runtime field type to prevent potential conflicts * Revert "[ML] Remove fit-content" This reverts commit 76c9c79 * [ML] Remove misc comment * [ML] Fix missing typeof * [ML] Add sorts and constants * [ML] Add i18n to includedFields description * [ML] fix imports * [ML] Only pass runtime mappings if it's latest * [ML] Fix functional tests
Summary
This PR adds better support for Transform and Data Frame Analytics on the UI side. Changes include:
Transforms
runtime_mappings
runtime_mappings
over to the index pattern if user opts to create new index pattern from wizardruntime_mappings
(either from index pattern or from API) will be editableFilter -> Range
controlsEditor
Pivot
Latest
Previews
Data Frame Analytics
Todos:
Checklist
Delete any items that are not applicable to this PR.