Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions sqlmesh/core/notification_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ def send(self, notification_status: NotificationStatus, msg: str, **kwargs: t.An
msg: The message to send.
"""

def notify_apply_start(self, environment: str, plan_id: str) -> None:
def notify_apply_start(
self, environment: str, plan_id: str, *args: t.Any, **kwargs: t.Any
) -> None:
"""Notify when an apply starts.

Args:
Expand All @@ -99,7 +101,9 @@ def notify_apply_start(self, environment: str, plan_id: str) -> None:
f"Plan `{plan_id}` apply started for environment `{environment}`.",
)

def notify_apply_end(self, environment: str, plan_id: str) -> None:
def notify_apply_end(
self, environment: str, plan_id: str, *args: t.Any, **kwargs: t.Any
) -> None:
"""Notify when an apply ends.

Args:
Expand All @@ -111,15 +115,15 @@ def notify_apply_end(self, environment: str, plan_id: str) -> None:
f"Plan `{plan_id}` apply finished for environment `{environment}`.",
)

def notify_run_start(self, environment: str) -> None:
def notify_run_start(self, environment: str, *args: t.Any, **kwargs: t.Any) -> None:
"""Notify when a SQLMesh run starts.

Args:
environment: The target environment of the run.
"""
self.send(NotificationStatus.INFO, f"SQLMesh run started for environment `{environment}`.")

def notify_run_end(self, environment: str) -> None:
def notify_run_end(self, environment: str, *args: t.Any, **kwargs: t.Any) -> None:
"""Notify when a SQLMesh run ends.

Args:
Expand All @@ -129,15 +133,17 @@ def notify_run_end(self, environment: str) -> None:
NotificationStatus.SUCCESS, f"SQLMesh run finished for environment `{environment}`."
)

def notify_migration_start(self) -> None:
def notify_migration_start(self, *args: t.Any, **kwargs: t.Any) -> None:
"""Notify when a SQLMesh migration starts."""
self.send(NotificationStatus.INFO, "SQLMesh migration started.")

def notify_migration_end(self) -> None:
def notify_migration_end(self, *args: t.Any, **kwargs: t.Any) -> None:
"""Notify when a SQLMesh migration ends."""
self.send(NotificationStatus.SUCCESS, "SQLMesh migration finished.")

def notify_apply_failure(self, environment: str, plan_id: str, exc: str) -> None:
def notify_apply_failure(
self, environment: str, plan_id: str, exc: str, *args: t.Any, **kwargs: t.Any
) -> None:
"""Notify in the case of an apply failure.

Args:
Expand All @@ -151,23 +157,23 @@ def notify_apply_failure(self, environment: str, plan_id: str, exc: str) -> None
exc=exc,
)

def notify_run_failure(self, exc: str) -> None:
def notify_run_failure(self, exc: str, *args: t.Any, **kwargs: t.Any) -> None:
"""Notify in the case of a run failure.

Args:
exc: The exception stack trace.
"""
self.send(NotificationStatus.FAILURE, "SQLMesh run failed.", exc=exc)

def notify_audit_failure(self, audit_error: AuditError) -> None:
def notify_audit_failure(self, audit_error: AuditError, *args: t.Any, **kwargs: t.Any) -> None:
"""Notify in the case of an audit failure.

Args:
audit_error: The AuditError object.
"""
self.send(NotificationStatus.FAILURE, "Audit failure.", audit_error=audit_error)

def notify_migration_failure(self, exc: str) -> None:
def notify_migration_failure(self, exc: str, *args: t.Any, **kwargs: t.Any) -> None:
"""Notify in the case of a migration failure.

Args:
Expand Down