rusackas commented on code in PR #41350:
URL: https://github.com/apache/superset/pull/41350#discussion_r3471479376
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -916,13 +922,13 @@ export default function transformProps(
minInterval:
xAxisType === AxisType.Time && timeGrainSqla && !forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
- timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
+ resolvedTimeGrain as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: 0,
maxInterval:
xAxisType === AxisType.Time && timeGrainSqla && forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
- timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
+ resolvedTimeGrain as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: undefined,
Review Comment:
Good catch — the guard was still keying off `timeGrainSqla` while the lookup
used `resolvedTimeGrain`. Switched both `minInterval`/`maxInterval` guards to
the resolved grain and added a fallback for grains missing from
`TIMEGRAIN_TO_TIMESTAMP`.
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -702,13 +708,13 @@ export default function transformProps(
minInterval:
xAxisType === AxisType.Time && timeGrainSqla && !forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
- timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
+ resolvedTimeGrain as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: 0,
maxInterval:
xAxisType === AxisType.Time && timeGrainSqla && forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
- timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
+ resolvedTimeGrain as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: undefined,
...getMinAndMaxFromBounds(
Review Comment:
Same fix applied here in MixedTimeseries — guards now use
`resolvedTimeGrain` so dashboard overrides drive the intervals too, with a safe
fallback for unmapped grains.
--
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]