codeant-ai-for-open-source[bot] commented on code in PR #44089:
URL: https://github.com/apache/superset/pull/44089#discussion_r4007209473


##########
superset/versioning/changes/shadow_queries.py:
##########
@@ -317,8 +340,14 @@ def _dashboard_child_records_for_tx_from_shadows(
         if prior_tx is None:
             continue
 
-        post_uuids = _dashboard_slice_uuids_at_tx(session, dashboard_id, 
transaction_id)
-        pre_uuids = _dashboard_slice_uuids_at_tx(session, dashboard_id, 
prior_tx)
+        # Resolve the attachment windows once (threading the committing
+        # *session* so the flushed-but-uncommitted current-tx association rows
+        # are visible), then take the pre/post membership by which windows
+        # contain each tx — the windows are tx-independent, so no need to
+        # re-scan the association history for both reads.
+        attached = charts_attached_to_dashboard(dashboard_id, session=session)
+        post_uuids = _dashboard_slice_uuids_at_tx(session, attached, 
transaction_id)
+        pre_uuids = _dashboard_slice_uuids_at_tx(session, attached, prior_tx)

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag the additional attachment-history reads and member-scoped 
slice scans in shadow query commit finalization when they are required to 
compute correct dashboard membership because Continuum does not close M2M 
association rows; these scans are intentionally bounded to affected dashboards.
   
   **Applied to:**
     - `superset/versioning/changes/shadow_queries.py`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



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