Skip to content
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

Add option to pivots which allows omitting empty values. #15814

Merged
merged 14 commits into from Jul 17, 2023

Conversation

dennisoelkers
Copy link
Member

@dennisoelkers dennisoelkers commented Jun 26, 2023

Description

Motivation and Context

In 5.0, we introduced returning empty values for individual groupings whenever documents are missing fields which are used for aggregations. To allow the user to have more control about if these should be returned or not, this PR is introducing an option for each grouping to define if empty values should be skipped. By default this is off, both for widgets which are already existing and for new ones.

Fixes Graylog2/graylog-plugin-enterprise#4851.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@dennisoelkers dennisoelkers force-pushed the fix/allow-skipping-empty-values-in-pivots branch from dc4a50e to 58a978b Compare June 26, 2023 12:08
@dennisoelkers dennisoelkers marked this pull request as ready for review June 27, 2023 09:04
@dennisoelkers dennisoelkers force-pushed the fix/allow-skipping-empty-values-in-pivots branch from 1844740 to 2b8822b Compare June 27, 2023 10:26
@dennisoelkers dennisoelkers marked this pull request as draft June 28, 2023 08:19
@dennisoelkers dennisoelkers marked this pull request as ready for review July 7, 2023 12:12
@luk-kaminski
Copy link
Contributor

Does not work when multiple fields added in single "Group by" widget:

Screenshot 2023-07-10 at 13-35-16 Graylog - Empty removal

The rest seems ok.
FE code was not reviewed.

Copy link
Contributor

@luk-kaminski luk-kaminski left a comment

Choose a reason for hiding this comment

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

BE part approved, great job, thx!

</SkipEmptyValuesHoverForHelp>
</SkipEmptyValuesLabel>
</SkipEmptyValuesCheckbox>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you considered unifying the layout with e.g. the visualization config checkboxes?

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I did it similar to the Rollup columns checkbox, because it is right next to it. I think we should create a follow-up task to make all consistent.

@linuspahl linuspahl merged commit 651447b into master Jul 17, 2023
6 checks passed
@linuspahl linuspahl deleted the fix/allow-skipping-empty-values-in-pivots branch July 17, 2023 15:37
dennisoelkers added a commit that referenced this pull request Jul 18, 2023
* Add optional option to skip empty values for pivot config.

* Implement strategy for skipping empty values when configured in pivot.

* Allow option only for `values` pivot.

* Fixing up inconsistencies.

* Adding helper function for pivot creation.

* Adding test case for disabling empty values.

* Adding changelog snippet.

* Adjusting expectations in test.

* Reusing constant in test.

* Handling skipping empty values for multi-field grouping.

* Handle partially missing fields in aggregations properly.

* Still use multi-terms in case empty values should be skipped.
linuspahl pushed a commit that referenced this pull request Jul 20, 2023
…5982)

* Add optional option to skip empty values for pivot config.

* Implement strategy for skipping empty values when configured in pivot.

* Allow option only for `values` pivot.

* Fixing up inconsistencies.

* Adding helper function for pivot creation.

* Adding test case for disabling empty values.

* Adding changelog snippet.

* Adjusting expectations in test.

* Reusing constant in test.

* Handling skipping empty values for multi-field grouping.

* Handle partially missing fields in aggregations properly.

* Still use multi-terms in case empty values should be skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants