kgabryje commented on code in PR #35683:
URL: https://github.com/apache/superset/pull/35683#discussion_r2672997114
##########
superset-frontend/plugins/plugin-chart-ag-grid-table/src/stateConversion.ts:
##########
@@ -68,6 +101,62 @@ function getTextComparator(type: string, value: string):
string {
return value;
}
+/**
+ * Converts a date filter to SQL clause.
+ * Handles both standard operators (equals, lessThan, etc.) and
+ * custom server-side operators (serverEquals, serverBefore, etc.).
+ *
+ * @param colId - Column identifier
+ * @param filter - AG Grid date filter object
+ * @returns SQL clause string or null if conversion not possible
+ */
+function convertDateFilterToSQL(
+ colId: string,
+ filter: AgGridFilter,
+): string | null {
+ const { type, dateFrom, dateTo } = filter;
+
+ if (!type) return null;
+
+ // Map custom server operators to standard ones
+ const normalizedType = DATE_FILTER_OPERATOR_MAP[type] || type;
+
+ switch (normalizedType) {
+ case 'equals':
Review Comment:
Could we use object fields instead of hardcoded strings? Here and the rest
of this file
--
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]