Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions superset/commands/report/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ def _get_log_data(self) -> HeaderDataType:
"dashboard_id": dashboard_id,
"owners": self._report_schedule.owners,
"slack_channels": slack_channels,
"execution_id": str(self._execution_id),
}
return log_data

Expand Down
6 changes: 5 additions & 1 deletion superset/reports/notifications/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,11 @@ def send(self) -> None:
header_data=content.header_data,
)
logger.info(
"Report sent to email, notification content is %s", content.header_data
"Report sent to email, task_id: %s, notification content is %s",
content.header_data.get("execution_id")
if content.header_data
else None,
content.header_data,
)
except SupersetErrorsException as ex:
raise NotificationError(
Expand Down
1 change: 1 addition & 0 deletions superset/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class HeaderDataType(TypedDict):
chart_id: int | None
dashboard_id: int | None
slack_channels: list[str] | None
execution_id: str | None


class DatasourceDict(TypedDict):
Expand Down
6 changes: 6 additions & 0 deletions tests/unit_tests/commands/report/execute_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def test_log_data_with_chart(mocker: MockerFixture) -> None:
"dashboard_id": None,
"owners": [1, 2],
"slack_channels": None,
"execution_id": "execution_id_example",
}

assert result == expected_result
Expand Down Expand Up @@ -94,6 +95,7 @@ def test_log_data_with_dashboard(mocker: MockerFixture) -> None:
"dashboard_id": 123,
"owners": [1, 2],
"slack_channels": None,
"execution_id": "execution_id_example",
}

assert result == expected_result
Expand Down Expand Up @@ -128,6 +130,7 @@ def test_log_data_with_email_recipients(mocker: MockerFixture) -> None:
"dashboard_id": 123,
"owners": [1, 2],
"slack_channels": [],
"execution_id": "execution_id_example",
}

assert result == expected_result
Expand Down Expand Up @@ -162,6 +165,7 @@ def test_log_data_with_slack_recipients(mocker: MockerFixture) -> None:
"dashboard_id": 123,
"owners": [1, 2],
"slack_channels": ["channel_1", "channel_2"],
"execution_id": "execution_id_example",
}

assert result == expected_result
Expand Down Expand Up @@ -195,6 +199,7 @@ def test_log_data_no_owners(mocker: MockerFixture) -> None:
"dashboard_id": 123,
"owners": [],
"slack_channels": ["channel_1", "channel_2"],
"execution_id": "execution_id_example",
}

assert result == expected_result
Expand Down Expand Up @@ -230,6 +235,7 @@ def test_log_data_with_missing_values(mocker: MockerFixture) -> None:
"dashboard_id": None,
"owners": [1, 2],
"slack_channels": ["channel_1", "channel_2"],
"execution_id": "execution_id_example",
}

assert result == expected_result
Expand Down
Loading