codeant-ai-for-open-source[bot] commented on code in PR #41738:
URL: https://github.com/apache/superset/pull/41738#discussion_r3518251897
##########
superset/migrations/shared/migrate_viz/processors.py:
##########
@@ -388,6 +388,11 @@ def _build_query(self) -> dict[str, Any]:
return super()._build_query()
+class MigrateCompareChart(TimeseriesChart):
+ source_viz_type = "compare"
+ target_viz_type = "echarts_timeseries_line"
Review Comment:
**Suggestion:** Add explicit type annotations for the new class-level
configuration variables so the introduced code complies with required Python
type hints. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The custom rule requires type hints on new or modified Python variables that
can be annotated. These class-level configuration attributes are new and
untyped, so the suggestion correctly identifies a real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=6eadaf95942d4efd9adef134fcb01e19&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=6eadaf95942d4efd9adef134fcb01e19&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/migrations/shared/migrate_viz/processors.py
**Line:** 391:393
**Comment:**
*Custom Rule: Add explicit type annotations for the new class-level
configuration variables so the introduced code complies with required Python
type hints.
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%2F41738&comment_hash=43aa503cf9e267e0deddbc3c48d8affb1edab8187fff8641e349eccb3f60cbd7&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41738&comment_hash=43aa503cf9e267e0deddbc3c48d8affb1edab8187fff8641e349eccb3f60cbd7&reaction=dislike'>👎</a>
##########
superset/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py:
##########
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""migrate_compare_chart_to_echarts
+
+Revision ID: e5f6a7b8c9d0
+Revises: d4e5f6a7b8c9
+Create Date: 2026-07-02 21:30:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import text
+from sqlalchemy.dialects.mysql.base import MySQLDialect
+
+from superset import db
+from superset.migrations.shared.migrate_viz import MigrateCompareChart
+
+# revision identifiers, used by Alembic.
+revision = "e5f6a7b8c9d0"
+down_revision = "d4e5f6a7b8c9"
+
+
+def upgrade():
Review Comment:
**Suggestion:** Add an explicit return type annotation to this migration
function to satisfy the required type-hint rule. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
The migration defines a new Python function without any type annotation,
which matches the type-hint rule for functions that can be annotated. A return
type such as `-> None` should be added.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=66d51cf631f0462983fd9831af4d0de7&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=66d51cf631f0462983fd9831af4d0de7&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/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py
**Line:** 37:37
**Comment:**
*Custom Rule: Add an explicit return type annotation to this migration
function to satisfy the required type-hint rule.
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%2F41738&comment_hash=b32774f77e6f4c0dc2ffcde452791cd349891da9e02d6a8fc6af055fe2a4a504&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41738&comment_hash=b32774f77e6f4c0dc2ffcde452791cd349891da9e02d6a8fc6af055fe2a4a504&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]