codeant-ai-for-open-source[bot] commented on code in PR #43392:
URL: https://github.com/apache/superset/pull/43392#discussion_r3831852424
##########
superset/dashboards/api.py:
##########
@@ -431,6 +434,15 @@ def get_list(self, **kwargs: Any) -> Response:
"""
return super().get_list(**kwargs)
+ def pre_get_list(self, data: dict[str, Any]) -> None:
+ """Attach ``extra_editors`` to each row, matching the single-object
GET."""
+ super().pre_get_list(data)
+ ids = data.get("ids", [])
+ extra_editors_by_id = get_extra_editors_by_pk(Dashboard, ids)
Review Comment:
**Suggestion:** The list endpoint now invokes `EXTRA_EDITORS_RESOLVER` once
for every dashboard in the page through `get_extra_editors_by_pk`. A resolver
that performs I/O or is computationally expensive therefore turns a single list
request into one resolver execution per row, multiplying latency and
potentially causing the entire listing to fail if any resolver invocation
raises. Use a bounded or batch-aware resolution strategy, or isolate resolver
failures so one problematic resource does not break the whole list response.
[performance]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Configured dashboard lists incur resolver work per row.
- ❌ Resolver failure can make dashboard listings return an API error.
- ⚠️ Large dashboard pages amplify custom resolver latency.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/dashboards/api.py
**Line:** 441:441
**Comment:**
*Performance: The list endpoint now invokes `EXTRA_EDITORS_RESOLVER`
once for every dashboard in the page through `get_extra_editors_by_pk`. A
resolver that performs I/O or is computationally expensive therefore turns a
single list request into one resolver execution per row, multiplying latency
and potentially causing the entire listing to fail if any resolver invocation
raises. Use a bounded or batch-aware resolution strategy, or isolate resolver
failures so one problematic resource does not break the whole list response.
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%2F43392&comment_hash=7f4746f181de19cf4cafff6ce649d4f39213c2b1c064ccbfff0d8abd26e8926d&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43392&comment_hash=7f4746f181de19cf4cafff6ce649d4f39213c2b1c064ccbfff0d8abd26e8926d&reaction=dislike'>👎</a>
##########
superset/charts/api.py:
##########
@@ -410,6 +413,15 @@ def get(self, id_or_uuid: str) -> Response:
except ChartNotFoundError:
return self.response_404()
+ def pre_get_list(self, data: dict[str, Any]) -> None:
+ """Attach ``extra_editors`` to each row, matching the single-object
GET."""
+ super().pre_get_list(data)
+ ids = data.get("ids", [])
+ extra_editors_by_id = get_extra_editors_by_pk(Slice, ids)
Review Comment:
**Suggestion:** The chart list path performs one `EXTRA_EDITORS_RESOLVER`
call for each chart returned by the page through `get_extra_editors_by_pk`.
This multiplies resolver latency with page size and propagates any resolver
exception as a list-request failure, unlike the previous list behavior. Use a
bounded or batch-aware resolution strategy, or handle per-chart resolver
failures without aborting the entire response. [performance]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ⚠️ Configured chart lists incur resolver work per returned chart.
- ❌ Resolver failure can make chart listings return an API error.
- ⚠️ Large chart pages amplify custom resolver latency.
```
</details>
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset/charts/api.py
**Line:** 420:420
**Comment:**
*Performance: The chart list path performs one `EXTRA_EDITORS_RESOLVER`
call for each chart returned by the page through `get_extra_editors_by_pk`.
This multiplies resolver latency with page size and propagates any resolver
exception as a list-request failure, unlike the previous list behavior. Use a
bounded or batch-aware resolution strategy, or handle per-chart resolver
failures without aborting the entire response.
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%2F43392&comment_hash=50d7e7d0ce2edb6eb833464c85009f83ceacb60ba83c05e7e933c26cc52a0271&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43392&comment_hash=50d7e7d0ce2edb6eb833464c85009f83ceacb60ba83c05e7e933c26cc52a0271&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]