Skip to content

Commit a611b9f

Browse files
committed
fix: sync emojis
1 parent 7d2a4ff commit a611b9f

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

  • elementary/monitor/data_monitoring/alerts/integrations/slack

elementary/monitor/data_monitoring/alerts/integrations/slack/slack.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
from elementary.clients.slack.schema import SlackBlocksType, SlackMessageSchema
1010
from elementary.clients.slack.slack_message_builder import MessageColor
1111
from elementary.config.config import Config
12+
from elementary.messages.blocks import Icon
13+
from elementary.messages.formats.unicode import ICON_TO_UNICODE
1214
from elementary.monitor.alerts.alerts_groups import AlertsGroup, GroupedByTableAlerts
1315
from elementary.monitor.alerts.alerts_groups.base_alerts_group import BaseAlertsGroup
1416
from elementary.monitor.alerts.model_alert import ModelAlertModel
@@ -171,8 +173,11 @@ def _get_dbt_test_template(
171173
)
172174

173175
compacted_sections = []
174-
if COLUMN_FIELD in (alert.alert_fields or DEFAULT_ALERT_FIELDS):
175-
compacted_sections.append(f"*Column*\n{alert.column_name or '_No column_'}")
176+
if (
177+
COLUMN_FIELD in (alert.alert_fields or DEFAULT_ALERT_FIELDS)
178+
and alert.column_name
179+
):
180+
compacted_sections.append(f"*Column*\n{alert.column_name}")
176181
if TAGS_FIELD in (alert.alert_fields or DEFAULT_ALERT_FIELDS):
177182
tags = prettify_and_dedup_list(alert.tags or [])
178183
compacted_sections.append(f"*Tags*\n{tags or '_No tags_'}")
@@ -223,7 +228,7 @@ def _get_dbt_test_template(
223228
result.extend(
224229
[
225230
self.message_builder.create_text_section_block(
226-
"*Test results sample*"
231+
f"{ICON_TO_UNICODE[Icon.MAGNIFYING_GLASS]} *Test results sample*"
227232
),
228233
self.message_builder.create_text_section_block(
229234
f"```{test_rows_sample_table}```"
@@ -332,8 +337,11 @@ def _get_elementary_test_template(
332337
)
333338

334339
compacted_sections = []
335-
if COLUMN_FIELD in (alert.alert_fields or DEFAULT_ALERT_FIELDS):
336-
compacted_sections.append(f"*Column*\n{alert.column_name or '_No column_'}")
340+
if (
341+
COLUMN_FIELD in (alert.alert_fields or DEFAULT_ALERT_FIELDS)
342+
and alert.column_name
343+
):
344+
compacted_sections.append(f"*Column*\n{alert.column_name}")
337345
if TAGS_FIELD in (alert.alert_fields or DEFAULT_ALERT_FIELDS):
338346
tags = prettify_and_dedup_list(alert.tags or [])
339347
compacted_sections.append(f"*Tags*\n{tags or '_No tags_'}")
@@ -1196,6 +1204,9 @@ def _create_single_alert_details_blocks(
11961204
if result:
11971205
details_blocks.extend(
11981206
[
1207+
self.message_builder.create_text_section_block(
1208+
f"{ICON_TO_UNICODE[Icon.INFO]} *Details*"
1209+
),
11991210
self.message_builder.create_divider_block(),
12001211
*result,
12011212
]

0 commit comments

Comments
 (0)