Skip to content

Commit 8f1bb0f

Browse files
committed
use fqn
1 parent 4a7348b commit 8f1bb0f

File tree

22 files changed

+32
-26
lines changed

22 files changed

+32
-26
lines changed

elementary/monitor/alerts/source_freshness_alert.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,9 @@ def data(self) -> Dict:
142142
freshness_description=self.freshness_description,
143143
)
144144

145-
def get_source_full_name(self) -> str:
146-
return f"{self.source_name}.{self.identifier}"
147-
148145
@property
149146
def concise_name(self) -> str:
150-
return f"source freshness alert - {self.get_source_full_name()}"
147+
return f"source freshness alert - {self.source_name}.{self.identifier}"
151148

152149
@property
153150
def error_message(self) -> str:
@@ -157,9 +154,16 @@ def error_message(self) -> str:
157154

158155
@property
159156
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+
)
160164
if self.original_status == "runtime error":
161-
return f'Failed to calculate the source freshness of "{self.get_source_full_name()}"'
162-
return f'Freshness exceeded the acceptable times on source "{self.get_source_full_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}"'
163167

164168
def get_report_link(self) -> Optional[ReportLinkData]:
165169
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.test_identifier\"",
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.test_identifier\"",
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.test_identifier\"",
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.test_identifier\"",
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.test_identifier\"",
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.test_identifier\"",
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.test_identifier\"",
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.test_identifier\"",
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.test_identifier\"",
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)