-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tchap failure and success notifications
- Loading branch information
Hajar AIT EL KADI
committed
Oct 27, 2023
1 parent
d55da67
commit 5158197
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from dag_datalake_sirene.utils.tchap import send_message | ||
|
||
|
||
def send_notification_success_tchap(**kwargs): | ||
doc_count = kwargs["ti"].xcom_pull( | ||
key="doc_count", task_ids="fill_elastic_siren_index" | ||
) | ||
send_message( | ||
f"\U0001F7E2 Données :" | ||
f"\nDAG d'indexation a été exécuté avec succès." | ||
f"\n - Nombre de documents indexés : {doc_count}" | ||
) | ||
|
||
|
||
def send_notification_failure_tchap(context): | ||
send_message("\U0001F534 Données :" "\nFail DAG d'indexation!!!!") |