Skip to content

Commit 36dbdff

Browse files
committed
Chore: Add args and kwargs parameters to BaseNotificationTarget notify_* functions
1 parent 3ea0493 commit 36dbdff

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

sqlmesh/core/notification_target.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ def send(self, notification_status: NotificationStatus, msg: str, **kwargs: t.An
8787
msg: The message to send.
8888
"""
8989

90-
def notify_apply_start(self, environment: str, plan_id: str) -> None:
90+
def notify_apply_start(
91+
self, environment: str, plan_id: str, *args: t.Any, **kwargs: t.Any
92+
) -> None:
9193
"""Notify when an apply starts.
9294
9395
Args:
@@ -99,7 +101,9 @@ def notify_apply_start(self, environment: str, plan_id: str) -> None:
99101
f"Plan `{plan_id}` apply started for environment `{environment}`.",
100102
)
101103

102-
def notify_apply_end(self, environment: str, plan_id: str) -> None:
104+
def notify_apply_end(
105+
self, environment: str, plan_id: str, *args: t.Any, **kwargs: t.Any
106+
) -> None:
103107
"""Notify when an apply ends.
104108
105109
Args:
@@ -111,15 +115,15 @@ def notify_apply_end(self, environment: str, plan_id: str) -> None:
111115
f"Plan `{plan_id}` apply finished for environment `{environment}`.",
112116
)
113117

114-
def notify_run_start(self, environment: str) -> None:
118+
def notify_run_start(self, environment: str, *args: t.Any, **kwargs: t.Any) -> None:
115119
"""Notify when a SQLMesh run starts.
116120
117121
Args:
118122
environment: The target environment of the run.
119123
"""
120124
self.send(NotificationStatus.INFO, f"SQLMesh run started for environment `{environment}`.")
121125

122-
def notify_run_end(self, environment: str) -> None:
126+
def notify_run_end(self, environment: str, *args: t.Any, **kwargs: t.Any) -> None:
123127
"""Notify when a SQLMesh run ends.
124128
125129
Args:
@@ -129,15 +133,17 @@ def notify_run_end(self, environment: str) -> None:
129133
NotificationStatus.SUCCESS, f"SQLMesh run finished for environment `{environment}`."
130134
)
131135

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

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

140-
def notify_apply_failure(self, environment: str, plan_id: str, exc: str) -> None:
144+
def notify_apply_failure(
145+
self, environment: str, plan_id: str, exc: str, *args: t.Any, **kwargs: t.Any
146+
) -> None:
141147
"""Notify in the case of an apply failure.
142148
143149
Args:
@@ -151,23 +157,23 @@ def notify_apply_failure(self, environment: str, plan_id: str, exc: str) -> None
151157
exc=exc,
152158
)
153159

154-
def notify_run_failure(self, exc: str) -> None:
160+
def notify_run_failure(self, exc: str, *args: t.Any, **kwargs: t.Any) -> None:
155161
"""Notify in the case of a run failure.
156162
157163
Args:
158164
exc: The exception stack trace.
159165
"""
160166
self.send(NotificationStatus.FAILURE, "SQLMesh run failed.", exc=exc)
161167

162-
def notify_audit_failure(self, audit_error: AuditError) -> None:
168+
def notify_audit_failure(self, audit_error: AuditError, *args: t.Any, **kwargs: t.Any) -> None:
163169
"""Notify in the case of an audit failure.
164170
165171
Args:
166172
audit_error: The AuditError object.
167173
"""
168174
self.send(NotificationStatus.FAILURE, "Audit failure.", audit_error=audit_error)
169175

170-
def notify_migration_failure(self, exc: str) -> None:
176+
def notify_migration_failure(self, exc: str, *args: t.Any, **kwargs: t.Any) -> None:
171177
"""Notify in the case of a migration failure.
172178
173179
Args:

0 commit comments

Comments
 (0)