Skip to content

Commit

Permalink
ELE-3709: Use get_report_link from alert class (#1722)
Browse files Browse the repository at this point in the history
* use class method

* lint
  • Loading branch information
dapollak authored Oct 29, 2024
1 parent 1f4e91c commit e18f353
Showing 1 changed file with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
SlackAlertMessageSchema,
)
from elementary.monitor.data_monitoring.alerts.integrations.utils.report_link import (
get_model_runs_link,
get_model_test_runs_link,
get_test_runs_link,
)
from elementary.tracking.tracking_interface import Tracking
from elementary.utils.json_utils import (
Expand Down Expand Up @@ -148,9 +146,8 @@ def _get_dbt_test_template(
),
)

test_runs_report_link = get_test_runs_link(
alert.report_url, alert.elementary_unique_id
)
test_runs_report_link = alert.get_report_link()

if test_runs_report_link:
report_link = self.message_builder.create_context_block(
[
Expand Down Expand Up @@ -314,9 +311,8 @@ def _get_elementary_test_template(
),
)

test_runs_report_link = get_test_runs_link(
alert.report_url, alert.elementary_unique_id
)
test_runs_report_link = alert.get_report_link()

if test_runs_report_link:
report_link = self.message_builder.create_context_block(
[
Expand Down Expand Up @@ -461,9 +457,8 @@ def _get_model_template(
),
)

model_runs_report_link = get_model_runs_link(
alert.report_url, alert.model_unique_id
)
model_runs_report_link = alert.get_report_link()

if model_runs_report_link:
report_link = self.message_builder.create_context_block(
[
Expand Down Expand Up @@ -565,9 +560,8 @@ def _get_snapshot_template(
),
)

model_runs_report_link = get_model_runs_link(
alert.report_url, alert.model_unique_id
)
model_runs_report_link = alert.get_report_link()

if model_runs_report_link:
report_link = self.message_builder.create_context_block(
[
Expand Down Expand Up @@ -653,9 +647,8 @@ def _get_source_freshness_template(
),
)

test_runs_report_link = get_test_runs_link(
alert.report_url, alert.source_freshness_execution_id
)
test_runs_report_link = alert.get_report_link()

if test_runs_report_link:
report_link = self.message_builder.create_context_block(
[
Expand Down

0 comments on commit e18f353

Please sign in to comment.