bito-code-review[bot] commented on code in PR #38392:
URL: https://github.com/apache/superset/pull/38392#discussion_r2882842086


##########
superset/mcp_service/chart/tool/generate_chart.py:
##########
@@ -384,6 +509,67 @@ async def generate_chart(  # noqa: C901
                 if form_data_key_list:
                     form_data_key = form_data_key_list[0]
 
+            # Compile check for preview-only mode
+            await ctx.report_progress(3, 5, "Running compile check (test 
query)")
+            numeric_dataset_id: int | None = None
+            if isinstance(request.dataset_id, int):
+                numeric_dataset_id = request.dataset_id
+            elif isinstance(request.dataset_id, str) and 
request.dataset_id.isdigit():
+                numeric_dataset_id = int(request.dataset_id)
+            else:
+                from superset.daos.dataset import DatasetDAO
+
+                ds = DatasetDAO.find_by_id(request.dataset_id, 
id_column="uuid")
+                if ds:
+                    numeric_dataset_id = ds.id

Review Comment:
   <!-- Bito Reply -->
   Yes, adding the `has_dataset_access(ds)` check in the preview compile path 
UUID lookup addresses the security issue by preventing unauthorized access to 
dataset compilation, matching the validation already in the save path.



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