Skip to content

Commit

Permalink
fix: NoneType value handled (#1908)
Browse files Browse the repository at this point in the history
  • Loading branch information
1101-1 committed Feb 12, 2024
1 parent 582e851 commit 5172f6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/azure/resoto_plugin_azure/resource/metrics.py
Expand Up @@ -151,7 +151,9 @@ def set_values(self, query_aggregations: Tuple[str, ...]) -> None:

for attr in query_aggregations:
# Extract attribute values for each metric
metric_attrs = [getattr(metric, attr) for metric in metric_values_result]
metric_attrs = [
getattr(metric, attr) for metric in metric_values_result if getattr(metric, attr) is not None
]
# Calculate the average value for the attribute across metrics and add it to metric_values list
if metric_attrs:
metric_values[attr] = sum(metric_attrs) / len(metric_attrs)
Expand Down

0 comments on commit 5172f6c

Please sign in to comment.