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


##########
superset-frontend/src/pages/DatasetList/index.tsx:
##########
@@ -610,7 +610,39 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
 
   const handleBulkDatasetExport = useCallback(
     async (datasetsToExport: Dataset[]) => {
-      const ids = datasetsToExport.map(({ id }) => id);
+      // The combined Datasources list mixes regular datasets (SqlaTable) with
+      // semantic views, which live in their own table with an independent id
+      // sequence. The dataset export endpoint looks rows up by bare numeric
+      // id against ``tables`` only — passing a semantic-view id silently
+      // returns whatever SqlaTable happens to share that id. Until a proper
+      // semantic-view export path exists, partition the selection and only
+      // ship dataset ids over to ``/api/v1/dataset/export/``.
+      const datasetRows = datasetsToExport.filter(
+        ({ kind }) => kind !== 'semantic_view',
+      );
+      const semanticViewCount = datasetsToExport.length - datasetRows.length;
+
+      if (datasetRows.length === 0) {
+        addDangerToast(
+          t(
+            'Exporting semantic views is not supported yet. ' +
+              'Deselect the semantic-view rows and try again.',
+          ),
+        );
+        return;
+      }
+
+      if (semanticViewCount > 0) {
+        addDangerToast(
+          t(
+            'Exporting semantic views is not supported yet — ' +
+              '%s semantic-view row(s) were skipped.',
+            semanticViewCount,
+          ),
+        );
+      }
+
+      const ids = datasetRows.map(({ id }) => id);

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing semantic_view export tests</b></div>
   <div id="fix">
   
   The semantic_view filtering logic (lines 620-643) has no test coverage. All 
existing export tests use mockDatasets with kind='physical' — the new branching 
paths (all-semantic early-return at 625-633, and mixed skip-warning at 635-643) 
are never exercised. This allows the filtering logic to silently break without 
test failure.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #ff3d13</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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