codeant-ai-for-open-source[bot] commented on code in PR #39469: URL: https://github.com/apache/superset/pull/39469#discussion_r3425655875
########## superset/migrations/versions/2026-05-13_12-00_c6219cac9270_add_user_session_auth_stamp_table.py: ########## @@ -0,0 +1,50 @@ +# 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. +"""add user_session_auth_stamp table + +Revision ID: c6219cac9270 +Revises: b7e4f2a891c3 +Create Date: 2026-05-13 12:00:00.000000 + +""" + +import sqlalchemy as sa + +from superset.migrations.shared.utils import create_table, drop_table + +# revision identifiers, used by Alembic. +revision = "c6219cac9270" +down_revision = "b7e4f2a891c3" + + +def upgrade() -> None: + create_table( + "user_session_auth_stamp", + sa.Column("user_id", sa.Integer(), nullable=False), + sa.Column("stamp", sa.String(length=36), nullable=False), + sa.ForeignKeyConstraint( + ["user_id"], + ["ab_user.id"], + name="fk_user_session_auth_stamp_user_id_ab_user", + ondelete="CASCADE", + ), + sa.PrimaryKeyConstraint("user_id", name="pk_user_session_auth_stamp"), + ) + + +def downgrade() -> None: + drop_table("user_session_auth_stamp") Review Comment: **Suggestion:** Add a short docstring to `downgrade` explaining that it reverts the table creation. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> The rule requires newly added Python functions to include docstrings. `downgrade()` is a new function in this newly created file and has no docstring, so the suggestion correctly identifies a real violation. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=017199733b054b4c850e77c56ca8548f&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=017199733b054b4c850e77c56ca8548f&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-05-13_12-00_c6219cac9270_add_user_session_auth_stamp_table.py **Line:** 49:50 **Comment:** *Custom Rule: Add a short docstring to `downgrade` explaining that it reverts the table creation. 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%2F39469&comment_hash=3bd9589ebd091614c5269ad4c7f6a1fbb818d04c872b79e87938afc84a351811&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=3bd9589ebd091614c5269ad4c7f6a1fbb818d04c872b79e87938afc84a351811&reaction=dislike'>👎</a> ########## superset/migrations/versions/2026-04-19_14-30_b7e4f2a891c3_add_auth_audit_log_table.py: ########## @@ -0,0 +1,54 @@ +# 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. +"""add auth_audit_log table + +Revision ID: b7e4f2a891c3 +Revises: ce6bd21901ab +Create Date: 2026-04-19 14:30:00.000000 + +""" + +import sqlalchemy as sa + +from superset.migrations.shared.utils import create_table, drop_table + +# revision identifiers, used by Alembic. +revision = "b7e4f2a891c3" +down_revision = "ce6bd21901ab" + + +def upgrade() -> None: + create_table( + "auth_audit_log", + sa.Column("id", sa.Integer(), nullable=False, autoincrement=True), + sa.Column("user_id", sa.Integer(), nullable=True), + sa.Column("event_type", sa.String(length=64), nullable=False), + sa.Column("ip_address", sa.String(length=256), nullable=True), + sa.Column("user_agent", sa.Text(), nullable=True), + sa.Column("metadata", sa.JSON(), nullable=True), + sa.Column("created_at", sa.DateTime(), nullable=False), + sa.ForeignKeyConstraint( + ["user_id"], + ["ab_user.id"], + name="fk_auth_audit_log_user_id_ab_user", + ), + sa.PrimaryKeyConstraint("id", name="pk_auth_audit_log"), + ) + + +def downgrade() -> None: + drop_table("auth_audit_log") Review Comment: **Suggestion:** Add a docstring to the new rollback function so its behavior is explicitly documented alongside the migration logic. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> The newly added `downgrade()` function also lacks a docstring. This violates the custom rule requiring docstrings for newly added Python functions and classes. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=41baf08209d14df1b4b085896dd7f01d&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=41baf08209d14df1b4b085896dd7f01d&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-04-19_14-30_b7e4f2a891c3_add_auth_audit_log_table.py **Line:** 53:54 **Comment:** *Custom Rule: Add a docstring to the new rollback function so its behavior is explicitly documented alongside the migration logic. 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%2F39469&comment_hash=37b32ee6e7470e3d6d6d4a9263a336756c5dd9eceb97b96840efb4e6ad150d0c&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=37b32ee6e7470e3d6d6d4a9263a336756c5dd9eceb97b96840efb4e6ad150d0c&reaction=dislike'>👎</a> ########## superset/migrations/versions/2026-06-16_16-00_33a0aac0a26a_merging_two_heads.py: ########## @@ -0,0 +1,35 @@ +# 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. +"""merging two heads + +Revision ID: 33a0aac0a26a +Revises: ('c6219cac9270', '33d7e0e21daa') +Create Date: 2026-06-16 16:00:00.000000 + +""" + +# revision identifiers, used by Alembic. +revision = "33a0aac0a26a" +down_revision = ("c6219cac9270", "33d7e0e21daa") + + +def upgrade() -> None: + pass + + +def downgrade() -> None: + pass Review Comment: **Suggestion:** Add an inline docstring to this new function clarifying that this merge migration has no downgrade actions. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This new function also lacks a docstring in the final file. Since the rule requires docstrings for newly added Python functions and classes, the suggestion identifies a genuine violation. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=19a9a8f3b72440f28818e0347221eaac&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=19a9a8f3b72440f28818e0347221eaac&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-06-16_16-00_33a0aac0a26a_merging_two_heads.py **Line:** 34:35 **Comment:** *Custom Rule: Add an inline docstring to this new function clarifying that this merge migration has no downgrade actions. 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%2F39469&comment_hash=ce1b09c39645ee617ae3094e1db69442371c7767ccb3ff6d16debdeb5acdded6&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=ce1b09c39645ee617ae3094e1db69442371c7767ccb3ff6d16debdeb5acdded6&reaction=dislike'>👎</a> ########## superset/migrations/versions/2026-04-19_14-30_b7e4f2a891c3_add_auth_audit_log_table.py: ########## @@ -0,0 +1,54 @@ +# 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. +"""add auth_audit_log table + +Revision ID: b7e4f2a891c3 +Revises: ce6bd21901ab +Create Date: 2026-04-19 14:30:00.000000 + +""" + +import sqlalchemy as sa + +from superset.migrations.shared.utils import create_table, drop_table + +# revision identifiers, used by Alembic. +revision = "b7e4f2a891c3" +down_revision = "ce6bd21901ab" + + +def upgrade() -> None: + create_table( + "auth_audit_log", + sa.Column("id", sa.Integer(), nullable=False, autoincrement=True), Review Comment: **Suggestion:** Replace the auto-incrementing integer primary key with a UUID-based primary key for the new audit table so new identifiers are not tied to internal sequential IDs. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> The migration introduces a new table with an auto-incrementing integer primary key. This matches the custom rule against adding new database models with sequential integer IDs when a UUID-based identifier should be used instead. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=b40a50bd78894847b50f0fa98b1f1be7&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=b40a50bd78894847b50f0fa98b1f1be7&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-04-19_14-30_b7e4f2a891c3_add_auth_audit_log_table.py **Line:** 37:37 **Comment:** *Custom Rule: Replace the auto-incrementing integer primary key with a UUID-based primary key for the new audit table so new identifiers are not tied to internal sequential IDs. 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%2F39469&comment_hash=133674b30dc0a226dad090783139358899b64a6452d447ce8f99cf2652915ac8&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=133674b30dc0a226dad090783139358899b64a6452d447ce8f99cf2652915ac8&reaction=dislike'>👎</a> ########## superset/migrations/versions/2026-05-13_12-00_c6219cac9270_add_user_session_auth_stamp_table.py: ########## @@ -0,0 +1,50 @@ +# 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. +"""add user_session_auth_stamp table + +Revision ID: c6219cac9270 +Revises: b7e4f2a891c3 +Create Date: 2026-05-13 12:00:00.000000 + +""" + +import sqlalchemy as sa + +from superset.migrations.shared.utils import create_table, drop_table + +# revision identifiers, used by Alembic. +revision = "c6219cac9270" +down_revision = "b7e4f2a891c3" + + +def upgrade() -> None: + create_table( + "user_session_auth_stamp", + sa.Column("user_id", sa.Integer(), nullable=False), + sa.Column("stamp", sa.String(length=36), nullable=False), + sa.ForeignKeyConstraint( + ["user_id"], + ["ab_user.id"], + name="fk_user_session_auth_stamp_user_id_ab_user", + ondelete="CASCADE", + ), + sa.PrimaryKeyConstraint("user_id", name="pk_user_session_auth_stamp"), + ) Review Comment: **Suggestion:** Add a short docstring to `upgrade` describing the schema change it applies. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> The rule requires newly added Python functions to include docstrings. `upgrade()` is a new function in a newly created migration file and has no docstring, so this is a real violation. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=60f5d3a315b74fb69c393de457c5a2c4&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=60f5d3a315b74fb69c393de457c5a2c4&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-05-13_12-00_c6219cac9270_add_user_session_auth_stamp_table.py **Line:** 34:46 **Comment:** *Custom Rule: Add a short docstring to `upgrade` describing the schema change it applies. 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%2F39469&comment_hash=8f1e4654d12ee42a8d52c33bc53f5f20fd12cb94aaf9eb413094bc011f5896b8&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=8f1e4654d12ee42a8d52c33bc53f5f20fd12cb94aaf9eb413094bc011f5896b8&reaction=dislike'>👎</a> ########## superset/migrations/versions/2026-06-16_16-00_33a0aac0a26a_merging_two_heads.py: ########## @@ -0,0 +1,35 @@ +# 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. +"""merging two heads + +Revision ID: 33a0aac0a26a +Revises: ('c6219cac9270', '33d7e0e21daa') +Create Date: 2026-06-16 16:00:00.000000 + +""" + +# revision identifiers, used by Alembic. +revision = "33a0aac0a26a" +down_revision = ("c6219cac9270", "33d7e0e21daa") + + +def upgrade() -> None: + pass Review Comment: **Suggestion:** Add an inline docstring to this new function describing that this merge migration intentionally performs no upgrade operations. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This new function has no docstring in the final file. The rule requires newly added Python functions and classes to include docstrings, so this is a real violation. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4dc47c1050dc4ace919a285c549e9021&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=4dc47c1050dc4ace919a285c549e9021&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-06-16_16-00_33a0aac0a26a_merging_two_heads.py **Line:** 30:31 **Comment:** *Custom Rule: Add an inline docstring to this new function describing that this merge migration intentionally performs no upgrade operations. 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%2F39469&comment_hash=f2edba8a8f6904f73fd21877443fb091397685a006410ec347ed8ec75de4ee73&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F39469&comment_hash=f2edba8a8f6904f73fd21877443fb091397685a006410ec347ed8ec75de4ee73&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]
