korbit-ai[bot] commented on code in PR #34595:
URL: https://github.com/apache/superset/pull/34595#discussion_r2259924886
##########
superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts:
##########
@@ -574,11 +575,17 @@ export default function transformProps(
},
minorTick: { show: minorTicks },
minInterval:
- xAxisType === AxisType.Time && timeGrainSqla
+ xAxisType === AxisType.Time && timeGrainSqla && !forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: 0,
+ maxInterval:
+ xAxisType === 'time' && timeGrainSqla && forceMaxInterval
Review Comment:
### Inconsistent xAxisType Check <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The code uses a string literal 'time' to check xAxisType when earlier it
uses the enum AxisType.Time
###### Why this matters
This inconsistency could cause the maxInterval logic to never execute if the
xAxisType is set using the enum, leading to the forceMaxInterval feature not
working as intended.
###### Suggested change ∙ *Feature Preview*
Replace the string literal check with the enum check to maintain consistency:
```typescript
maxInterval:
xAxisType === AxisType.Time && timeGrainSqla && forceMaxInterval
? TIMEGRAIN_TO_TIMESTAMP[
timeGrainSqla as keyof typeof TIMEGRAIN_TO_TIMESTAMP
]
: undefined,
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/37bd13f3-3240-4417-966f-4e2c46837900/upvote)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/37bd13f3-3240-4417-966f-4e2c46837900?what_not_true=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/37bd13f3-3240-4417-966f-4e2c46837900?what_out_of_scope=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/37bd13f3-3240-4417-966f-4e2c46837900?what_not_in_standard=true)
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/37bd13f3-3240-4417-966f-4e2c46837900)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:58d1f800-80ec-456b-93e2-0447801930e0 -->
[](58d1f800-80ec-456b-93e2-0447801930e0)
--
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]