bito-code-review[bot] commented on PR #40818:
URL: https://github.com/apache/superset/pull/40818#issuecomment-4651600975

   <!-- Bito Reply -->
   Extracting `findDatasetIdByName` into a helper function is a good practice, 
as it improves readability and reusability across tests. Since this is a test 
file, you could move it to a shared utility file (e.g., 
`superset-frontend/playwright/helpers/api/dataset.ts`) if other tests need to 
look up datasets by name.
   
   
**superset-frontend/playwright/tests/dashboard/mixed-chart-dashboard-filters.spec.ts**
   ```
   async function findDatasetIdByName(page: any, name: string): Promise<number> 
{
     const query = `(filters:!((col:table_name,opr:eq,value:'${name}')))`;
     const resp = await page.request.get(`api/v1/dataset/?q=${query}`);
     const body = await resp.json();
     if (!body.result?.length) {
       throw new Error(`Dataset ${name} not found`);
     }
     return body.result[0].id;
   }
   ```


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