-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Transforms: Data grid fixes. #59538
[ML] Transforms: Data grid fixes. #59538
Conversation
77aa174
to
b760225
Compare
b760225
to
b68f9f3
Compare
@elasticmachine merge upstream |
Pinging @elastic/ml-ui (:ml) |
let schema = 'string'; | ||
// Built-in values are ['boolean', 'currency', 'datetime', 'numeric', 'json'] | ||
// To fall back to the default string schema it needs to be undefined. | ||
let schema; |
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.
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.
Pushed a fix in c6b9430 - I thought I implemented that already in the original PR but seems it got lost somehow.
…com:walterra/kibana into ml-transforms-data-grid-fix-date-formatting
Probably not related to the changes in this PR, but are zero values being rendered as blank cells in the preview table? If I try and sort by
|
@peteharverson Fixed the empty cells in 760ae8a. |
In 66161ff I improved the sorting related error handling: For other non-catchable error the messages is improved now to display the full error instead of just I couldn't find a way to filter the list of available fields for sorting to be passed on to |
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.
Tested latest changes and generally LGTM.
Would be preferable if the table wasn't lost completely if for example the user tries to sort on a non-aggregatable text
field. With the ecommerce data, if you pick the first category
field to sort on, the table is lost and you have to start all over with creating the transform. Ideally we would look to hide fields that don't support sorting in the EuiDataGrid sorting popover.
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.
Overall LGMT 👍 just a couple of nit comments
import { getNestedProperty } from './object_utils'; | ||
|
||
describe('object_utils', () => { | ||
test('getNestedProperty()', () => { |
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.
nit: I believe it'd be better to have test per expect here because assertations are not related
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.
I'll leave it as is since this is a 1:1 copy of the same file we have in the ML plugin. I'd like to consolidate related files in a shared space for both plugins at some point then we can also refactor the these tests.
const valid = sc.reduce((v, c) => { | ||
if (v === false) return v; | ||
const columnType = dataGridColumns.find(dgc => dgc.id === c.id); | ||
const validSortingType = columnType?.schema !== 'json'; | ||
if (validSortingType === false) { | ||
toastNotifications.addDanger( | ||
i18n.translate('xpack.transform.sourceIndexPreview.invalidSortingColumnError', { | ||
defaultMessage: `The column '{columnId}' cannot be used for sorting.`, | ||
values: { columnId: c.id }, | ||
}) | ||
); | ||
} | ||
return validSortingType; | ||
}, true); |
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.
I find usage of reduce
a bit confusing here:
- it has a side effect inside
- if one of the soring is invalid it doesn't check the others
It might be better to use find
to get the first invalid one and show the toastNotifications after
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.
Tweaked in d17b83b.
const indexPatternTitle = Array.isArray(transformConfig.source.index) | ||
? transformConfig.source.index.join(',') | ||
: transformConfig.source.index; |
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.
potentially might be an issue if the joint index patter does not exist (has a different order etc)
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.
@peteharverson I tweaked the behavior so the data grid will not be hidden when an error occurs: |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: Add a retry to dashboard test for a sometimes slow async operation (elastic#59600) [Endpoint] Sample data generator for endpoint app (elastic#58936) [Vis Editor] Refactoring metrics axes (elastic#59135) [DOCS] Changed Discover app to Discover (elastic#59769) [Metrics Alerts] Add support for search query and groupBy on alerts (elastic#59388) Enhancement - EUICodeEditor for Visualize JSON (elastic#58679) [ML] Transforms: Data grid fixes. (elastic#59538) [SIEM] Fix and consolidate handling of error responses in the client (elastic#59438) [Maps] convert tooltip classes to typescript (elastic#59589) [ML] Functional tests - re-activate date_nanos test (elastic#59649) Move canvas to use NP Expressions service (elastic#58387) Update misc dependencies (elastic#59542) [Unit Testing] Configure react-testing-library queries to use Kibana's data-test-subj instead of default data-testid (elastic#59445) [Console] Remove unused code (elastic#59554) [Logs / Metrics UI] Link handling / stop page reloads (elastic#58478) Add SavedObject management section registration in core (elastic#59291)
- Fixes data grid schemas to avoid crashing the page. - Fixes date formatting. - Uses data grid for preview table in transform list. Co-authored-by: Elastic Machine <[email protected]>
Summary
Part of #51288.
Fixes #59416.
Checklist
For maintainers