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


##########
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:
   also we can be more flexible about the shape of the data that way, and if it 
changes, we don't have to update it in many places. The only thing that really 
relies on the shape is the config method which is optional. 



-- 
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