PrakharAgarwal17 commented on code in PR #46008:
URL: https://github.com/apache/superset/pull/46008#discussion_r4473252258
##########
superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts:
##########
@@ -218,32 +215,32 @@ export const buildQuery: BuildQuery<TableChartFormData> =
(
}
const temporalColumnsLookup = formData?.temporal_columns_lookup;
- // Filter out the column if needed and prepare the temporal column object
-
- columns = columns.filter(col => {
- const shouldBeAdded =
+ let firstTemporalColumn: AdhocColumn | undefined;
+ columns = columns.map(col => {
+ if (
isPhysicalColumn(col) &&
time_grain_sqla &&
- temporalColumnsLookup?.[col];
-
- if (shouldBeAdded && !temporalColumnAdded) {
- temporalColumn = {
+ temporalColumnsLookup?.[col]
+ ) {
+ const temporalColumn: AdhocColumn = {
timeGrain: time_grain_sqla,
columnType: 'BASE_AXIS',
sqlExpression: col,
label: col,
expressionType: 'SQL',
...(isSemanticView ? { isColumnReference: true } : {}),
Review Comment:
Addressed in 67bf0fc:
- Updated `test_aggregate_table_promotes_only_first_lookup_temporal_groupby`
to expect grain on every temporal group-by column.
- Added `isColumnReference: true` to grained physical temporal columns in
both the Table and AG Grid query builders.
- Updated the related expectations in
`plugin-chart-table/test/buildQuery.test.ts` for ordinary dataset grain,
dashboard grain override, and form-data grain fallback, plus the AG Grid
temporal-column test.
--
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]