Skip to content

Commit 13697e9

Browse files
authored
Merge pull request #1971 from elementary-data/ele-4832-full-source-name-in-freshness-alerts
full source name in freshness alerts
2 parents 8e97187 + 8f1bb0f commit 13697e9

File tree

22 files changed

+31
-22
lines changed

22 files changed

+31
-22
lines changed

elementary/monitor/alerts/source_freshness_alert.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,16 @@ def error_message(self) -> str:
154154

155155
@property
156156
def summary(self) -> str:
157+
source_fqn = ".".join(
158+
[
159+
part
160+
for part in [self.database_name, self.schema_name, self.identifier]
161+
if part
162+
]
163+
)
157164
if self.original_status == "runtime error":
158-
return f'Failed to calculate the source freshness of "{self.source_name}"'
159-
return f'Freshness exceeded the acceptable times on source "{self.source_name}"'
165+
return f'Failed to calculate the source freshness of "{source_fqn}"'
166+
return f'Freshness exceeded the acceptable times on source "{source_fqn}"'
160167

161168
def get_report_link(self) -> Optional[ReportLinkData]:
162169
return get_test_runs_link(self.report_url, self.source_freshness_execution_id)

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-error_link-False_message-False_tags-True_owners-True_path-True_error-True_suppression-False_env-False.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Error: Freshness exceeded the acceptable times on source \"test_source\"",
13+
"text": "Error: Freshness exceeded the acceptable times on source \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-error_link-False_message-True_tags-True_owners-True_path-False_error-True_suppression-False_env-True.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Error: Freshness exceeded the acceptable times on source \"test_source\"",
13+
"text": "Error: Freshness exceeded the acceptable times on source \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-error_link-True_message-False_tags-False_owners-False_path-False_error-False_suppression-True_env-False.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Error: Freshness exceeded the acceptable times on source \"test_source\"",
13+
"text": "Error: Freshness exceeded the acceptable times on source \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-error_link-True_message-False_tags-True_owners-True_path-True_error-False_suppression-True_env-False.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Error: Freshness exceeded the acceptable times on source \"test_source\"",
13+
"text": "Error: Freshness exceeded the acceptable times on source \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-error_link-True_message-True_tags-False_owners-False_path-True_error-True_suppression-True_env-True.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Error: Freshness exceeded the acceptable times on source \"test_source\"",
13+
"text": "Error: Freshness exceeded the acceptable times on source \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-runtime error_link-False_message-False_tags-False_owners-False_path-False_error-False_suppression-False_env-False.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Runtime Error: Failed to calculate the source freshness of \"test_source\"",
13+
"text": "Runtime Error: Failed to calculate the source freshness of \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-runtime error_link-False_message-True_tags-True_owners-False_path-False_error-True_suppression-True_env-True.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Runtime Error: Failed to calculate the source freshness of \"test_source\"",
13+
"text": "Runtime Error: Failed to calculate the source freshness of \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-runtime error_link-True_message-False_tags-True_owners-False_path-True_error-False_suppression-True_env-True.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Runtime Error: Failed to calculate the source freshness of \"test_source\"",
13+
"text": "Runtime Error: Failed to calculate the source freshness of \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

tests/unit/alerts/alert_messages/fixtures/adaptive_card/source_freshness_alert_status-runtime error_link-True_message-True_tags-False_owners-True_path-False_error-True_suppression-False_env-True.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"items": [
1111
{
1212
"type": "TextBlock",
13-
"text": "Runtime Error: Failed to calculate the source freshness of \"test_source\"",
13+
"text": "Runtime Error: Failed to calculate the source freshness of \"test_db.test_schema.test_identifier\"",
1414
"weight": "bolder",
1515
"size": "large",
1616
"wrap": true

0 commit comments

Comments
 (0)