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


##########
superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts:
##########
@@ -150,6 +150,25 @@ export default class SupersetClientClass {
     }
   }
 
+  /**
+   * POST request that returns a blob for file downloads.
+   * Unlike postForm, this uses AJAX so errors can be caught and handled.
+   * @param endpoint - API endpoint
+   * @param payload - Request payload
+   * @returns Promise resolving to Response with blob
+   */
+  async postBlob(
+    endpoint: string,
+    payload: Record<string, any>,

Review Comment:
   **Suggestion:** Replace `Record<string, any>` with a stricter payload type 
(such as an existing reusable request payload type or `Record<string, 
unknown>`) so the new API method does not introduce `any`. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new `postBlob` method is TypeScript code and its `payload` parameter 
uses `Record<string, any>`, which directly introduces the `any` type. This 
matches the rule against new or modified TypeScript/TSX code using `any`, so 
the suggestion is valid.
   </details>
   
   [Fix in 
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=80112b236d2e4c518272453cf9798838&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 | [Fix in VSCode 
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=80112b236d2e4c518272453cf9798838&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts
   **Line:** 162:162
   **Comment:**
        *Custom Rule: Replace `Record<string, any>` with a stricter payload 
type (such as an existing reusable request payload type or `Record<string, 
unknown>`) so the new API method does not introduce `any`.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37131&comment_hash=462a7e166a0ee205b47c14ec06e5f475759d8b411290bd3f68b5634900c8b8a4&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37131&comment_hash=462a7e166a0ee205b47c14ec06e5f475759d8b411290bd3f68b5634900c8b8a4&reaction=dislike'>👎</a>



##########
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.jsx:
##########
@@ -0,0 +1,112 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import React from 'react';
+import { render, screen, waitFor } from 'spec/helpers/testing-library';
+import userEvent from '@testing-library/user-event';
+import { useExploreAdditionalActionsMenu } from './index';
+import * as exploreUtils from 'src/explore/exploreUtils';
+
+jest.mock('src/explore/exploreUtils', () => ({
+  __esModule: true,
+  ...jest.requireActual('src/explore/exploreUtils'),
+  exportChart: jest.fn(),
+  getChartKey: jest.fn(() => 'test_chart_key'),
+}));
+
+const mockAddDangerToast = jest.fn();
+jest.mock('src/components/MessageToasts/withToasts', () => ({
+  __esModule: true,
+  default: component => component,
+  useToasts: () => ({
+    addDangerToast: mockAddDangerToast,
+    addSuccessToast: jest.fn(),
+  }),
+}));
+
+jest.mock('src/logger/actions', () => ({
+  logEvent: jest.fn(() => ({ type: 'LOG_EVENT' })),
+}));
+
+const defaultProps = {
+  latestQueryFormData: {
+    datasource: '1__table',
+    viz_type: 'pivot_table_v2',
+  },
+  canDownloadCSV: true,
+  slice: { slice_id: 1, slice_name: 'Test Chart' },
+  ownState: {},
+  dashboards: [],
+  onOpenInEditor: jest.fn(),
+  onOpenPropertiesModal: jest.fn(),
+  showReportModal: jest.fn(),
+  setCurrentReportDeleting: jest.fn(),
+};
+
+const TestComponent = props => {

Review Comment:
   **Suggestion:** Convert this new frontend test file from `.test.jsx` to 
`.test.tsx` and add explicit prop typing (or reuse an existing hook prop type) 
so the test follows the TypeScript-first frontend standard. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added frontend test file with a `.jsx` extension, which 
matches the rule against adding new JavaScript source files in the frontend. 
The suggestion to convert it to `.tsx` and add typing is therefore aligned with 
a real rule violation in the current code.
   </details>
   
   [Fix in 
Cursor](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=bd16642858c64839a02760cb6eb792e7&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 | [Fix in VSCode 
Claude](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=bd16642858c64839a02760cb6eb792e7&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/useExploreAdditionalActionsMenu.test.jsx
   **Line:** 61:61
   **Comment:**
        *Custom Rule: Convert this new frontend test file from `.test.jsx` to 
`.test.tsx` and add explicit prop typing (or reuse an existing hook prop type) 
so the test follows the TypeScript-first frontend standard.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37131&comment_hash=fa4e126680970c3ea5426c840dffc9c23270eb690aae274475afe74d36670c6b&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F37131&comment_hash=fa4e126680970c3ea5426c840dffc9c23270eb690aae274475afe74d36670c6b&reaction=dislike'>👎</a>



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