File tree Expand file tree Collapse file tree
elementary/monitor/alerts/alert_messages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,15 @@ def _get_run_alert_subtitle_block(
125125 )
126126 return LinesBlock (lines = subtitle_lines )
127127
128+ def _get_run_alert_subtitle_links (
129+ self ,
130+ alert : Union [TestAlertModel , SourceFreshnessAlertModel , ModelAlertModel ],
131+ ) -> List [ReportLinkData ]:
132+ report_link = alert .get_report_link ()
133+ if report_link :
134+ return [report_link ]
135+ return []
136+
128137 def _get_run_alert_subtitle_blocks (
129138 self ,
130139 alert : Union [TestAlertModel , SourceFreshnessAlertModel , ModelAlertModel ],
@@ -140,7 +149,7 @@ def _get_run_alert_subtitle_blocks(
140149 elif isinstance (alert , ModelAlertModel ):
141150 asset_type = "snapshot" if alert .materialization == "snapshot" else "model"
142151 asset_name = alert .alias
143- report_link = alert . get_report_link ( )
152+ links = self . _get_run_alert_subtitle_links ( alert )
144153 return [
145154 self ._get_run_alert_subtitle_block (
146155 type = asset_type ,
@@ -149,7 +158,7 @@ def _get_run_alert_subtitle_blocks(
149158 detected_at_str = alert .detected_at_str ,
150159 suppression_interval = alert .suppression_interval ,
151160 env = alert .env ,
152- links = [ report_link ] if report_link else [] ,
161+ links = links ,
153162 )
154163 ]
155164
You can’t perform that action at this time.
0 commit comments