bito-code-review[bot] commented on code in PR #38584:
URL: https://github.com/apache/superset/pull/38584#discussion_r3455771810
##########
superset-frontend/src/types/Dashboard.ts:
##########
@@ -36,6 +36,7 @@ export interface Dashboard {
owners: Owner[];
extra_owners?: Owner[];
roles: Role[];
+ is_managed_externally?: boolean;
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Type inconsistency with backend contract</b></div>
<div id="fix">
The `is_managed_externally` field is defined as non-optional (`boolean`) in
`Chart.ts` (lines 59, 75) and is always returned by the backend API (included
in `extra_import_fields` at `dashboard.py:193` with `nullable=False,
default=False`). Making it optional creates type inconsistency and implies the
field may not exist, which contradicts the backend contract.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
--- a/superset-frontend/src/types/Dashboard.ts
+++ b/superset-frontend/src/types/Dashboard.ts
@@ -36,7 +36,7 @@ export interface Dashboard {
owners: Owner[];
extra_owners?: Owner[];
roles: Role[];
- is_managed_externally?: boolean;
+ is_managed_externally: boolean;
theme?: {
id: number;
theme_name: string;
json_data: string;
```
</div>
</details>
</div>
<small><i>Code Review Run #007097</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]