fix: annotate already_added_keys to satisfy mypy
The parameter-level annotation on _check_keys_and_notif_id alone wasn't enough -- mypy needs the type at the empty list's declaration site inside filter_notification_alerts. Also reformatted the helper's now-longer signature to satisfy ruff. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -420,7 +420,7 @@ class SlotManager(SientiaMonitoring):
|
|||||||
receiver_groups[group_name] = {**receiver_group, 'notifications': []}
|
receiver_groups[group_name] = {**receiver_group, 'notifications': []}
|
||||||
receiver_groups[group_name]['notifications'] = []
|
receiver_groups[group_name]['notifications'] = []
|
||||||
|
|
||||||
already_added_keys = []
|
already_added_keys: list[str] = []
|
||||||
|
|
||||||
ignore_list = receiver_group.get('ignore', [])
|
ignore_list = receiver_group.get('ignore', [])
|
||||||
levels_list = receiver_group.get('levels')
|
levels_list = receiver_group.get('levels')
|
||||||
@@ -486,7 +486,9 @@ class SlotManager(SientiaMonitoring):
|
|||||||
return level_check and model_id_check
|
return level_check and model_id_check
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _check_keys_and_notif_id(notification_id, ignore_list, key, already_added_keys) -> bool:
|
def _check_keys_and_notif_id(
|
||||||
|
notification_id, ignore_list, key, already_added_keys: list[str]
|
||||||
|
) -> bool:
|
||||||
"""
|
"""
|
||||||
Check if the key has already been added to the list of already added keys.
|
Check if the key has already been added to the list of already added keys.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user