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


##########
tests/unit_tests/utils/test_screenshot_cache_fix.py:
##########
@@ -76,6 +78,7 @@ class TestCacheOnlyOnSuccess:
 
     def _setup_mocks(self, mocker: MockerFixture, screenshot_obj):
         """Helper method to set up common mocks."""
+        mocker.patch(DISTRIBUTED_LOCK_PATH)

Review Comment:
   **Suggestion:** Add full type hints to the modified `_setup_mocks` method, 
including the `screenshot_obj` parameter and an explicit return type. 
[custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The modified `_setup_mocks` method is a Python function whose signature 
still lacks a type hint for `screenshot_obj` and does not declare a return 
type. Since this test helper is being changed, it should be fully typed 
according to the rule.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=17f53af812a34535bd360b1115d4b09c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=17f53af812a34535bd360b1115d4b09c&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:** tests/unit_tests/utils/test_screenshot_cache_fix.py
   **Line:** 79:81
   **Comment:**
        *Custom Rule: Add full type hints to the modified `_setup_mocks` 
method, including the `screenshot_obj` parameter and an explicit return type.
   
   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%2F38576&comment_hash=72a66f31eff98b063dd4e7eba89346a68d11cc27f9bb21eac16b6e39f4e2417f&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=72a66f31eff98b063dd4e7eba89346a68d11cc27f9bb21eac16b6e39f4e2417f&reaction=dislike'>👎</a>



##########
tests/unit_tests/utils/test_screenshot_cache_fix.py:
##########
@@ -194,7 +197,7 @@ class TestShouldTriggerTask:
     def test_trigger_on_stale_computing_status(self, mock_app):
         """Test that stale COMPUTING status triggers recomputation."""
         # Set TTL to 300 seconds
-        mock_app.config = {"THUMBNAIL_ERROR_CACHE_TTL": 300}
+        mock_app.config = {"THUMBNAIL_COMPUTING_CACHE_TTL": 300}

Review Comment:
   **Suggestion:** Add type annotations to the modified 
`test_trigger_on_stale_computing_status` method (for `mock_app`) and include an 
explicit `-> None` return type. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The modified `test_trigger_on_stale_computing_status` function still has an 
untyped `mock_app` parameter and no return annotation. Because this function is 
part of the changed code, it violates the typing rule.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4189777d81694c7c91a2b60b2a27d916&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4189777d81694c7c91a2b60b2a27d916&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:** tests/unit_tests/utils/test_screenshot_cache_fix.py
   **Line:** 197:200
   **Comment:**
        *Custom Rule: Add type annotations to the modified 
`test_trigger_on_stale_computing_status` method (for `mock_app`) and include an 
explicit `-> None` return type.
   
   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%2F38576&comment_hash=857e22451f1ec5f1ff694d63a2555479a047b6912a349e8c9ee803c6a180bcb5&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=857e22451f1ec5f1ff694d63a2555479a047b6912a349e8c9ee803c6a180bcb5&reaction=dislike'>👎</a>



##########
tests/unit_tests/utils/test_screenshot_cache_fix.py:
##########
@@ -260,8 +265,10 @@ def test_trigger_on_expired_error(self, mock_app):
     @patch("superset.utils.screenshots.app")
     def test_no_trigger_on_fresh_error(self, mock_app):
         """Test that fresh ERROR status does not trigger task."""
-        # Set TTL to 300 seconds
-        mock_app.config = {"THUMBNAIL_ERROR_CACHE_TTL": 300}
+        mock_app.config = {
+            "THUMBNAIL_COMPUTING_CACHE_TTL": 300,
+            "THUMBNAIL_ERROR_CACHE_TTL": 300,
+        }

Review Comment:
   **Suggestion:** Add missing type hints in the modified 
`test_no_trigger_on_fresh_error` method signature, including `mock_app` and the 
return type. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The `test_no_trigger_on_fresh_error` method is modified and still lacks type 
hints for `mock_app` and a return annotation. That is a real violation of the 
rule for changed Python functions.
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=9181748314354a2ab8bce2eebb106719&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=9181748314354a2ab8bce2eebb106719&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:** tests/unit_tests/utils/test_screenshot_cache_fix.py
   **Line:** 266:271
   **Comment:**
        *Custom Rule: Add missing type hints in the modified 
`test_no_trigger_on_fresh_error` method signature, including `mock_app` and the 
return type.
   
   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%2F38576&comment_hash=79dc496b46b263ec944490346a4c7af5bcb0b4dc7f12306279700d46861cabcb&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=79dc496b46b263ec944490346a4c7af5bcb0b4dc7f12306279700d46861cabcb&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]

Reply via email to