Fail gracefully if opmon project is not runnable

This commit is contained in:
Anna Scholtz 2022-05-19 13:55:29 -07:00
Родитель e3594c681b
Коммит 7ea34600dd
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -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."""
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}"