Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

Commit b5f4840

Browse files
Rémi REYrrey
authored andcommitted
Fix bug on annotation filtering
If multiple annotations were retrieved in the period, they were never filtered ...
1 parent d9de7e8 commit b5f4840

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

library/grafana_annotations.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,12 @@ def default_filter(annos, annotation):
8989
"""default filter comparing 'time', 'text' and 'tags' parameters"""
9090
result = []
9191
for anno in annos:
92-
for key in ['time', 'text', 'tags']:
93-
if anno.get(key) != annotation.get(key):
94-
continue
92+
if anno.get('time') != annotation.get('time'):
93+
continue
94+
if anno.get('text') != annotation.get('text'):
95+
continue
96+
if anno.get('tags') != annotation.get('tags'):
97+
continue
9598
result.append(anno)
9699
return result
97100

0 commit comments

Comments
 (0)