aminghadersohi commented on code in PR #38408:
URL: https://github.com/apache/superset/pull/38408#discussion_r2886227728


##########
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 and has_dataset_access(ds):

Review Comment:
   Fixed in cde36ea. The preview-only compile check now validates dataset 
existence and user access for numeric IDs before running any queries. Both 
`int` and digit-string dataset IDs now go through `DatasetDAO.find_by_id()` + 
`has_dataset_access()`, matching the saved-chart path and UUID preview 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