Skip to content

Conversation

@moibra05
Copy link
Contributor

@moibra05 moibra05 commented Jan 2, 2026

Because

  • Some metric points do not contain the point field and are throwing errors b/c the current code assumes otherwise
  • The issue here is that abs() is attempting to be called on these values which throw errors when point is None

This commit

  • Adds a guard to check if the accessed point is None before calling abs

Fixes #14240


@register.filter
def to_percentage(value, precision=None):
if value is None or type(value) not in [int, float]:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if value is None or type(value) not in [int, float]:
if value is None or type(value) not in (int, float):

tuples are cheaper than lists because they are not mutable.

@moibra05 moibra05 added this pull request to the merge queue Jan 5, 2026
Merged via the queue into main with commit c3103c7 Jan 5, 2026
17 checks passed
@moibra05 moibra05 deleted the 14240 branch January 5, 2026 22:30
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.

Absolute value calculated on nonexistent points

4 participants