codeant-ai-for-open-source[bot] commented on code in PR #42300:
URL: https://github.com/apache/superset/pull/42300#discussion_r3628032294
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts:
##########
@@ -724,6 +724,40 @@ export default function transformProps(
}
}
+ // When explicit Y axis bounds are set, clamp series values to those bounds
+ // instead of leaving raw out-of-range values in place. ECharts axis
+ // clipping can otherwise drop an out-of-bounds point (and the line
+ // segments around it) entirely rather than truncating it at the
+ // boundary (see https://github.com/apache/superset/issues/27449).
+ if (yAxisMin !== undefined || yAxisMax !== undefined) {
Review Comment:
**Suggestion:** The new comment says clamping happens only when explicit
bounds are set, but the condition triggers for any defined bound value,
including non-explicit values assigned earlier in transform logic; this
mismatch makes the behavior easy to misread and can lead to unintended clamping
in future edits. Update the comment or narrow the condition so implementation
and description match. [comment mismatch]
<details>
<summary><b>Severity Level:</b> Minor π§Ή</summary>
```mdx
- β οΈ Code comment misstates clamping trigger condition.
- β οΈ Possible minor developer confusion when maintaining code.
```
</details>
<details>
<summary><b>Steps of Reproduction β
</b></summary>
```mdx
1. Configure a Timeseries chart without explicit Y axis min or max, so
bounds are derived
automatically in `transformProps` (see lines 714β724 where `yAxisMax` and
`yAxisMin` can
be set from `effectiveDataMax` and `dataMin` when undefined).
2. Render the chart, causing `transformProps` in
`superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts`
to run
and compute `yAxisMin`/`yAxisMax` based on data even though the user did not
set explicit
bounds.
3. At lines 727β732, the clamping block guarded by `if (yAxisMin !==
undefined || yAxisMax
!== undefined)` executes because these derived bounds are defined,
regardless of whether
they were explicitly configured by the user.
4. The runtime behavior (clamping whenever any axis bounds exist) is
consistent and
intentional for avoiding dropped points, but the comment specifically says
βWhen explicit
Y axis bounds are set,β which does not match the broader condition; the
discrepancy is
limited to developer-facing documentation and does not change chart output.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=92681971b81c4623afc4a4d479bce141&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=92681971b81c4623afc4a4d479bce141&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent π€ </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
**Line:** 727:732
**Comment:**
*Comment Mismatch: The new comment says clamping happens only when
explicit bounds are set, but the condition triggers for any defined bound
value, including non-explicit values assigned earlier in transform logic; this
mismatch makes the behavior easy to misread and can lead to unintended clamping
in future edits. Update the comment or narrow the condition so implementation
and description match.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42300&comment_hash=955d60f6bcc71e063fad46204995dfb0e7f3cf00cbb7624a2103a0f95564d782&reaction=like'>π</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42300&comment_hash=955d60f6bcc71e063fad46204995dfb0e7f3cf00cbb7624a2103a0f95564d782&reaction=dislike'>π</a>
--
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]