villebro commented on code in PR #23575:
URL: https://github.com/apache/superset/pull/23575#discussion_r1158162635


##########
superset-frontend/packages/superset-ui-core/src/query/types/Filter.ts:
##########
@@ -58,6 +58,7 @@ export interface FreeFormAdhocFilter {
   expressionType: 'SQL';
   clause: 'WHERE' | 'HAVING';
   sqlExpression: string;
+  isExtra?: boolean;

Review Comment:
   HIGHLY optional, but.. While we're at it, I believe `timeGrain` is also a 
valid prop for `FreeFormAdhocFilter`, similar to `BaseSimpleAdhocFilter` (at 
least it should be). The fact that this and `timeGrain` was missing here kinda 
indicates that we might benefit from some added abstraction, like
   
   ```typescript
   interface BaseAdhocFilter = {
     clause: 'WHERE' | 'HAVING';
     timeGrain?: TimeGranularity;
     isExtra?: boolean;
   }
   
   type BaseSimpleAdhocFilter =  BaseAdhocFilter & {
     expressionType: 'SIMPLE';
     subject: string;
   }
   
   export type FreeFormAdhocFilter = BaseAdhocFilter & {
     expressionType: 'SQL';
     sqlExpression: string;
   }
   ```



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