aminghadersohi commented on code in PR #45571:
URL: https://github.com/apache/superset/pull/45571#discussion_r4351302904


##########
superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/EchartsSunburst.tsx:
##########
@@ -120,26 +123,53 @@ export default function EchartsSunburst(props: 
SunburstTransformedProps) {
         const drillToDetailFilters: BinaryQueryObjectFilterClause[] = [];
         const drillByFilters: BinaryQueryObjectFilterClause[] = [];
         if (columns?.length) {
-          treePath.forEach((path, i) =>
-            drillToDetailFilters.push({
-              col: columns[i],
-              op: '==',
-              val: records[i],
-              formattedVal: path,
-            }),
-          );
-          const val = treePath[treePath.length - 1];
-          drillByFilters.push({
-            col: columns[treePath.length - 1],
-            op: '==',
-            val,
-            formattedVal: formatSeriesName(val, {
-              timeFormatter: getTimeFormatter(formData.dateFormat),
-              numberFormatter: getNumberFormatter(formData.numberFormat),
-              coltype:
-                coltypeMapping?.[getColumnLabel(columns[treePath.length - 1])],
-            }),
+          const timeGrain = (formData.extraFormData?.time_grain_sqla ??

Review Comment:
   Fixed in 80118e754d0f087124087fdfc59ebae3e4e2a8e5. EchartsSunburstFormData 
explicitly declares temporalColumnsLookup, granularitySqla and timeGrainSqla; 
the drill code no longer casts the grain from the index signature.
   
   Regression test: `Sunburst temporal field types reject malformed saved 
metadata` in 
`superset-frontend/plugins/plugin-chart-echarts/test/Sunburst/timeGrain.test.ts`
 has three compile-time guards. Restoring the previous types produces three 
TS2578 unused-directive failures; the targeted TypeScript pre-commit check 
passes with the declarations. `typed temporal fields select the same grain for 
rendering and querying` also pins the shared helper's runtime contract.
   
   Siblings checked:
   - superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/types.ts — 
fixed in 80118e754d0f087124087fdfc59ebae3e4e2a8e5
   - 
superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/EchartsSunburst.tsx 
— fixed in 80118e754d0f087124087fdfc59ebae3e4e2a8e5
   - superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/timeGrain.ts — 
fixed in 80118e754d0f087124087fdfc59ebae3e4e2a8e5
   - superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/buildQuery.ts 
— not affected: the query builder consumes the core snake-case QueryFormData 
contract rather than camel-case transformed props
   
   
   Final head: `8cc881ab51c29c79d574d7b254933fa7babd3019`.
   



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