@@ -73,6 +73,9 @@ def _get_color(self, alert_status: Optional[str]) -> Optional[Color]:
7373 return None
7474 return self .STATUS_COLORS .get (alert_status )
7575
76+ def _get_alert_color (self , alert : AlertType ) -> Optional [Color ]:
77+ return self ._get_color (alert .status )
78+
7679 def _get_alert_title (
7780 self , summary : str , status : Optional [str ], test_type : Optional [str ]
7881 ) -> str :
@@ -580,22 +583,20 @@ def _get_alert_config_blocks(
580583
581584 def _get_alert_groups_blocks (
582585 self ,
583- alert : Union [ AlertsGroup , GroupedByTableAlerts ] ,
586+ alert : AlertsGroup ,
584587 ) -> List [MessageBlock ]:
585- if isinstance (alert , AlertsGroup ):
586- return self ._get_sub_alert_groups_blocks (
587- model_errors = alert .model_errors ,
588- test_failures = alert .test_failures ,
589- test_warnings = alert .test_warnings ,
590- test_errors = alert .test_errors ,
591- )
592- return []
588+ return self ._get_sub_alert_groups_blocks (
589+ model_errors = alert .model_errors ,
590+ test_failures = alert .test_failures ,
591+ test_warnings = alert .test_warnings ,
592+ test_errors = alert .test_errors ,
593+ )
593594
594595 def build (
595596 self ,
596597 alert : AlertType ,
597598 ) -> MessageBody :
598- color = self ._get_color (alert . status )
599+ color = self ._get_alert_color (alert )
599600
600601 blocks : List [MessageBlock ] = []
601602
@@ -618,7 +619,7 @@ def build(
618619 config_blocks = self ._get_alert_config_blocks (alert )
619620 blocks .extend (config_blocks )
620621
621- if isinstance (alert , ( AlertsGroup , GroupedByTableAlerts ) ):
622+ if isinstance (alert , AlertsGroup ):
622623 alert_groups_blocks = self ._get_alert_groups_blocks (alert )
623624 blocks .extend (alert_groups_blocks )
624625
0 commit comments