From 33fc57854d3e3b0702511e8960a09128591a27ec Mon Sep 17 00:00:00 2001 From: AAfghahi <48933336+AAfghahi@users.noreply.github.com> Date: Fri, 28 Oct 2022 19:43:37 -0400 Subject: [PATCH] fix: error_parsing (#21946) --- superset/reports/commands/execute.py | 3 --- superset/utils/core.py | 1 - .../reports/commands/execute_dashboard_report_tests.py | 2 +- tests/unit_tests/notifications/email_tests.py | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/superset/reports/commands/execute.py b/superset/reports/commands/execute.py index 41efb4821d50..a8776f0d7d8a 100644 --- a/superset/reports/commands/execute.py +++ b/superset/reports/commands/execute.py @@ -322,7 +322,6 @@ def _get_log_data(self) -> HeaderDataType: "chart_id": chart_id, "dashboard_id": dashboard_id, "owners": self._report_schedule.owners, - "error_text": None, } return log_data @@ -354,7 +353,6 @@ def _get_notification_content(self) -> NotificationContent: if not csv_data: error_text = "Unexpected missing csv file" if error_text: - header_data["error_text"] = error_text return NotificationContent( name=self._report_schedule.name, text=error_text, @@ -434,7 +432,6 @@ def send_error(self, name: str, message: str) -> None: :raises: NotificationError """ header_data = self._get_log_data() - header_data["error_text"] = message logger.info( "header_data in notifications for alerts and reports %s, taskid, %s", header_data, diff --git a/superset/utils/core.py b/superset/utils/core.py index a893696e024f..4a088be5dd64 100644 --- a/superset/utils/core.py +++ b/superset/utils/core.py @@ -197,7 +197,6 @@ class HeaderDataType(TypedDict): notification_source: Optional[str] chart_id: Optional[int] dashboard_id: Optional[int] - error_text: Optional[str] class DatasourceDict(TypedDict): diff --git a/tests/integration_tests/reports/commands/execute_dashboard_report_tests.py b/tests/integration_tests/reports/commands/execute_dashboard_report_tests.py index 54de4cdf28b6..0027738fd980 100644 --- a/tests/integration_tests/reports/commands/execute_dashboard_report_tests.py +++ b/tests/integration_tests/reports/commands/execute_dashboard_report_tests.py @@ -110,4 +110,4 @@ def test_report_with_header_data( assert header_data.get("notification_format") == report_schedule.report_format assert header_data.get("notification_source") == ReportSourceFormat.DASHBOARD assert header_data.get("notification_type") == report_schedule.type - assert len(send_email_smtp_mock.call_args.kwargs["header_data"]) == 7 + assert len(send_email_smtp_mock.call_args.kwargs["header_data"]) == 6 diff --git a/tests/unit_tests/notifications/email_tests.py b/tests/unit_tests/notifications/email_tests.py index 1df40e22f95b..4ce34b99cac4 100644 --- a/tests/unit_tests/notifications/email_tests.py +++ b/tests/unit_tests/notifications/email_tests.py @@ -41,7 +41,6 @@ def test_render_description_with_html() -> None: "notification_source": None, "chart_id": None, "dashboard_id": None, - "error_text": None, }, ) email_body = (