mikebridge commented on code in PR #39973:
URL: https://github.com/apache/superset/pull/39973#discussion_r3573813936


##########
superset/commands/report/execute.py:
##########
@@ -274,23 +277,30 @@ def _get_url(
         # Every content path (_get_screenshots, _get_csv_data,
         # _get_embedded_data, _get_notification_content) funnels through this
         # method, so this is the single choke point.
-        if (
-            self._report_schedule.chart_id is not None
-            and self._report_schedule.chart is None
-        ):
+        if self._report_schedule.chart_id is not None and chart is None:
             raise ReportScheduleTargetChartDeletedError()
         # Symmetric guard for dashboard targets. Dashboard soft delete lands
         # in the sibling rollout; until then this cannot fire (a dashboard
         # with dependent reports cannot be deleted), which makes it inert
         # rather than wrong — and it keeps the report-target error vocabulary
         # parallel across entities from day one.
-        if (
-            self._report_schedule.dashboard_id is not None
-            and self._report_schedule.dashboard is None
-        ):
+        if self._report_schedule.dashboard_id is not None and dashboard is 
None:
             raise ReportScheduleTargetDashboardDeletedError()

Review Comment:
   Fixed in 643491e24. Deleted-target errors are now selected only when neither 
relationship resolves, so a valid chart is not blocked by a stale non-target 
dashboard reference. Added 
`test_get_url_uses_valid_chart_with_stale_dashboard_reference`; the complete 
report test module passes all 78 tests, and all applicable PR-file pre-commit 
hooks pass.



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