eschutho commented on code in PR #20903:
URL: https://github.com/apache/superset/pull/20903#discussion_r940751719


##########
superset/reports/commands/execute.py:
##########
@@ -342,23 +343,34 @@ def _get_notification_content(self) -> 
NotificationContent:
         ):
             embedded_data = self._get_embedded_data()
 
+        notification_source = None
+        notification_source_id = None
         if self._report_schedule.chart:
             name = (
                 f"{self._report_schedule.name}: "
                 f"{self._report_schedule.chart.slice_name}"
             )
+            notification_source = ReportSourceFormat.CHART
+            notification_source_id = self._report_schedule.chart_id
         else:
             name = (
                 f"{self._report_schedule.name}: "
                 f"{self._report_schedule.dashboard.dashboard_title}"
             )
+            notification_source = ReportSourceFormat.DASHBOARDS
+            notification_source_id = self._report_schedule.dashboard_id
+
         return NotificationContent(
             name=name,
             url=url,
             screenshots=screenshot_data,
             description=self._report_schedule.description,
             csv=csv_data,
             embedded_data=embedded_data,
+            notification_type=self._report_schedule.type,
+            notification_source=notification_source,
+            notification_source_id=notification_source_id,
+            notification_format=self._report_schedule.report_format,

Review Comment:
   I would suggest grouping all of this new content together into either 
log_data or header_data since it all serves the same function and doesn't need 
to be passed in separately. It also makes it clear with that naming what it's 
going to be used for. 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to