-
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
[Lens] Fix multi terms fields validation #126618
Conversation
🕺 A little bit of dance as I thought to have applied the commit in the wrong branch :D |
@elasticmachine merge upstream |
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
This looks mostly good to me, but there are two things we should put into consideration:
- Using date fields in a multi field terms was allowed previously, now we disallow it. This is a breaking change. Are we fine with this?
- It's still weird it's possible to select the field from the list - maybe we should just not select the field if we know it's going to be invalid?
cc @ghudgins as these are product questions too
I thought about this as well, but given dates not being supported for single term Top values, finding them enabled on multi terms (for disabled fields on the dropdown) is a good hint for no support.
Fair point. Should this be extended also to single term mode? |
Yeah, true, I don't expect it to become an issue
No, in single term mode it's switching to date histogram which is a useful behavior. |
@flash1293 I've added some logic to remove fields with unsupported type when in multi-terms mode. |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Sorry for the delay in review - it's close but in the single field case it should switch to date histogram automatically. At least that's what is happening for other operations, e.g. selecting a date field on "Intervals" switches to date histogram. If possible I would like to have this behaving consistent for the single field case. |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
I think this switch behaviour has changed some time ago. On the other hand testing it on a 7.17 instance the behaviour still has the automatic switch. Perhaps it is worth a distinct issue for it? |
I think it stopped working with the multi terms change (as the field change handling is now done on the terms operation level). Fine with splitting it out from this PR. |
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 for the rest of the behavior
Created #127258 |
Summary
Fix #126343
This PR provides an in depth rewrite of the field validation logic, taking into accounts new multi-fields column and per field specific validation error.
The rewrite managed to reduce the amount of check/validation logic into a single function, and fix some bugs around multi terms and drag and drop combine action, together with better error messages.
Unsupported types are discarded for the combine action now:
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers