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

   <!-- Bito Reply -->
   The flagged issue is correct. The original implementation relied on the 
presence of a `dataset` property to distinguish between form inputs and saved 
filters. This caused filters without a `dataset` (like `filter_time`) to be 
incorrectly identified as saved filters, leading to the loss of critical 
configuration fields during the transformation process.
   
   The fix implemented in the PR correctly updates the `isFormInput` 
discriminator to check for the presence of the `targets` property instead. 
Since all saved filters are guaranteed to have a `targets` array, this is a 
reliable way to distinguish them from form inputs.
   
   I have verified the changes in 
`superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/filterTransformer.ts`
 and the corresponding test cases in `filterTransformer.test.ts`. The 
implementation is correct and addresses the reported issue.
   
   
**superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/transformers/filterTransformer.ts**
   ```
   function isFormInput(
     formInputs: NativeFilterFormOrSaved,
   ): formInputs is NativeFiltersFormItem {
     return !('targets' in formInputs);
   }
   ```


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