codeant-ai-for-open-source[bot] commented on code in PR #40130:
URL: https://github.com/apache/superset/pull/40130#discussion_r3510303122


##########
tests/integration_tests/datasets/api_tests.py:
##########
@@ -1957,17 +1974,32 @@ def test_delete_dataset_item(self):
         """
 
         dataset = self.insert_default_dataset()
+        dataset_id = dataset.id

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not require explicit scalar type annotations for local test-scaffolding 
variables when their types are already unambiguous from context and the 
annotation would add noise without improving mypy coverage.
   
   **Applied to:**
     - `**/test/**`
     - `**/tests/**`
     - `**/*test*.<ext>`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



##########
tests/integration_tests/datasets/api_tests.py:
##########
@@ -1957,17 +1974,32 @@ def test_delete_dataset_item(self):
         """
 
         dataset = self.insert_default_dataset()
+        dataset_id = dataset.id
         view_menu = security_manager.find_view_menu(dataset.get_perm())
         assert view_menu is not None
         view_menu_id = view_menu.id
         self.login(ADMIN_USERNAME)
         uri = f"api/v1/dataset/{dataset.id}"
         rv = self.client.delete(uri)
         assert rv.status_code == 200
+        # With soft delete, the row still exists (with deleted_at set) so
+        # FAB permissions are preserved for potential restore.
         non_view_menu = db.session.query(security_manager.viewmenu_model).get(
             view_menu_id
         )
-        assert non_view_menu is None
+        assert non_view_menu is not None
+
+        # Hard-delete the soft-deleted row to avoid unique constraint
+        # collisions in subsequent tests
+        row = (
+            db.session.query(SqlaTable)
+            .execution_options(**{SKIP_VISIBILITY_FILTER_CLASSES: {SqlaTable}})
+            .filter(SqlaTable.id == dataset_id)
+            .one_or_none()
+        )

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag missing type annotations for local test-scaffolding variables 
in test files when the type is obvious from context; these annotations add 
noise without improving mypy coverage.
   
   **Applied to:**
     - `**/test/**`
     - `**/tests/**`
     - `**/*test*.<ext>`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



##########
tests/unit_tests/commands/databases/sync_permissions_test.py:
##########
@@ -409,3 +409,49 @@ def test_sync_permissions_command_rename_db_in_perms(
     assert (
         mock_chart.schema_perm == 
f"[{database_with_catalog.name}].[catalog1].[schema1]"
     )
+
+
+def test_sync_permissions_command_rename_bypasses_visibility_filter(
+    mocker: MockerFixture, database_with_catalog: MagicMock
+):

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not require explicit return type annotations on new or modified test 
functions in test files when the return type is obvious from context and the 
annotation would add noise.
   
   **Applied to:**
     - `**/test/**`
     - `**/tests/**`
     - `**/*test*.<ext>`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



-- 
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]

Reply via email to