From 6a784c34283d557878f2e25cae0a37663ca70a88 Mon Sep 17 00:00:00 2001 From: IDoneShaveIt Date: Mon, 5 Feb 2024 17:00:34 +0200 Subject: [PATCH] Handle None message for model alerts (skipped models) --- elementary/monitor/alerts/model_alert.py | 2 +- elementary/monitor/fetchers/alerts/schema/alert_data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elementary/monitor/alerts/model_alert.py b/elementary/monitor/alerts/model_alert.py index 3b79614ff..75648507b 100644 --- a/elementary/monitor/alerts/model_alert.py +++ b/elementary/monitor/alerts/model_alert.py @@ -19,9 +19,9 @@ def __init__( path: str, original_path: str, materialization: str, - message: str, full_refresh: bool, alert_class_id: str, + message: Optional[str] = None, model_unique_id: Optional[str] = None, detected_at: Optional[datetime] = None, database_name: Optional[str] = None, diff --git a/elementary/monitor/fetchers/alerts/schema/alert_data.py b/elementary/monitor/fetchers/alerts/schema/alert_data.py index 8d0a69569..5a4b76215 100644 --- a/elementary/monitor/fetchers/alerts/schema/alert_data.py +++ b/elementary/monitor/fetchers/alerts/schema/alert_data.py @@ -229,7 +229,7 @@ class ModelAlertDataSchema(BaseAlertDataSchema): original_path: str materialization: str full_refresh: bool - message: str + message: Optional[str] = None resource_type: ResourceType = Field(ResourceType.MODEL, const=True) def format_alert(