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

Transformations: Fix Timeseries to table transformation trend reduction when result is 0 #78026

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

oserde
Copy link
Contributor

@oserde oserde commented Nov 12, 2023

When reduceField function returns 0, the reduced value is set to null. I think we can remove this "|| null" statement, as:

  • There is a check a few lines above to make sure the field type is a number. This might be a reasonable guarantee that the calculation we are doing will make sense and there will be no need to set to null.
  • Sparkline cell type already has an option to hide value if we believe the calculation does not make sense.

Fixes #78025

…on when result is 0

When reduceField function returns 0, the reduced value is set to null. I
think we can remove this "|| null" statement, as:
- There is a check a few lines above to make sure the field type is a number. This might be a reasonable guarantee that the calculation we are doing will make sense and there will be no need to set to null.
- Sparkline cell type already has an option to hide value if we believe the calculation
  does not make sense.

Fixes grafana#78025
@oserde oserde requested review from a team, oscarkilhed and baldm0mma and removed request for a team November 12, 2023 09:57
@grafana-pr-automation grafana-pr-automation bot added area/frontend pr/external This PR is from external contributor labels Nov 12, 2023
@CLAassistant
Copy link

CLAassistant commented Nov 12, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@oscarkilhed oscarkilhed left a comment

Choose a reason for hiding this comment

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

Thank you for your submission!

@oscarkilhed oscarkilhed added no-changelog Skip including change in changelog/release notes no-backport Skip backport of PR type/bug labels Nov 13, 2023
@oscarkilhed oscarkilhed added this to the 10.3.x milestone Nov 14, 2023
@oscarkilhed oscarkilhed added add to changelog and removed no-changelog Skip including change in changelog/release notes labels Nov 14, 2023
@oscarkilhed
Copy link
Contributor

Went ahead and updated the PR with my suggested changes.

Copy link
Contributor

@baldm0mma baldm0mma left a comment

Choose a reason for hiding this comment

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

lgtm!

@oscarkilhed oscarkilhed merged commit 20f541d into grafana:main Nov 15, 2023
19 checks passed
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/frontend no-backport Skip backport of PR pr/external This PR is from external contributor type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SparklineCell: No value shown when calculated trend value is 0
6 participants