From 7ea34600dd531a0f10793f4c842deeebb628f4b8 Mon Sep 17 00:00:00 2001 From: Anna Scholtz Date: Thu, 19 May 2022 13:55:29 -0700 Subject: [PATCH] Fail gracefully if opmon project is not runnable --- opmon/monitoring.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opmon/monitoring.py b/opmon/monitoring.py index b723987..2f63b3a 100644 --- a/opmon/monitoring.py +++ b/opmon/monitoring.py @@ -63,7 +63,12 @@ class Monitoring: def _run_sql_for_data_type(self, submission_date: datetime, data_type: str): """Generate and execute the ETL for a specific data type.""" - self._check_runnable(submission_date) + try: + self._check_runnable(submission_date) + except Exception as e: + print(f"Failed to run opmon project: {e}") + return + date_partition = str(submission_date).replace("-", "").split(" ")[0] destination_table = f"{self.normalized_slug}_{data_type}${date_partition}"