codeant-ai-for-open-source[bot] commented on code in PR #38576: URL: https://github.com/apache/superset/pull/38576#discussion_r3477240787
########## tests/unit_tests/tasks/test_thumbnails.py: ########## @@ -0,0 +1,140 @@ +# 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. + +from unittest.mock import MagicMock, patch + +import pytest + + [email protected] Review Comment: **Suggestion:** Add explicit type annotations for the fixture return value so the new fixture is fully typed. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This is a newly added Python fixture function with no return type annotation. The rule requires new Python code to be fully typed, so the omission is a real violation. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=698344299a464dcd83a1cc32095015b4&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=698344299a464dcd83a1cc32095015b4&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/tasks/test_thumbnails.py **Line:** 23:23 **Comment:** *Custom Rule: Add explicit type annotations for the fixture return value so the new fixture is fully typed. 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=3c090e4cbeeb8c6f0f83e49c39d1880a2da146b2fc835132d7908bb191acbc2f&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=3c090e4cbeeb8c6f0f83e49c39d1880a2da146b2fc835132d7908bb191acbc2f&reaction=dislike'>👎</a> ########## tests/unit_tests/tasks/test_thumbnails.py: ########## @@ -0,0 +1,140 @@ +# 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. + +from unittest.mock import MagicMock, patch + +import pytest + + [email protected] +def mock_thumbnail_cache(): + with patch("superset.tasks.thumbnails.thumbnail_cache", True): + yield + + [email protected] Review Comment: **Suggestion:** Add a return type annotation to this fixture to comply with the requirement that new Python functions are fully typed. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This is a new Python fixture function without a return type annotation. Since the file is newly added and new Python code should be fully typed, this violates the type-hint rule. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d521ee78f84644f3b8294d05152f2209&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=d521ee78f84644f3b8294d05152f2209&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/tasks/test_thumbnails.py **Line:** 29:29 **Comment:** *Custom Rule: Add a return type annotation to this fixture to comply with the requirement that new Python functions are fully typed. 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=5344db8e9ae6becc5a3c1fd2361cfd3bc52b80756677f6652d33f6a2b51db9e9&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=5344db8e9ae6becc5a3c1fd2361cfd3bc52b80756677f6652d33f6a2b51db9e9&reaction=dislike'>👎</a> ########## tests/unit_tests/tasks/test_thumbnails.py: ########## @@ -0,0 +1,140 @@ +# 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. + +from unittest.mock import MagicMock, patch + +import pytest + + [email protected] +def mock_thumbnail_cache(): + with patch("superset.tasks.thumbnails.thumbnail_cache", True): + yield + + [email protected] +def mock_dashboard(): + dashboard = MagicMock() + dashboard.id = 1 + dashboard.digest = "test_digest" + return dashboard + + +def _make_screenshot_mock(cache_key: str = "test_cache_key") -> MagicMock: + screenshot = MagicMock() + screenshot.get_cache_key.return_value = cache_key + return screenshot + + +# --------------------------------------------------------------------------- +# Helpers shared across tests +# --------------------------------------------------------------------------- + +_COMMON_PATCHES = [ + "superset.tasks.thumbnails.get_executor", + "superset.tasks.thumbnails.security_manager", + "superset.tasks.thumbnails.override_user", + "superset.tasks.thumbnails.get_url_path", + "superset.tasks.thumbnails.DashboardScreenshot", +] + + +def _apply_patches(fn): + """Stack the five common patches onto a test function.""" + for p in reversed(_COMMON_PATCHES): + fn = patch(p)(fn) + return fn + + +# --------------------------------------------------------------------------- +# Tests +# --------------------------------------------------------------------------- + + +@patch("superset.tasks.thumbnails.thumbnail_cache", None) +def test_cache_dashboard_thumbnail_skips_when_no_cache(): + """Task exits early when no thumbnail cache is configured.""" + from superset.tasks.thumbnails import cache_dashboard_thumbnail + + result = cache_dashboard_thumbnail(current_user="admin", dashboard_id=1, force=True) + + assert result is None + + +@_apply_patches +def test_cache_dashboard_thumbnail_always_delegates_to_compute_and_cache( + mock_screenshot_cls, + mock_get_url_path, + mock_override_user, + mock_security_manager, + mock_get_executor, + mock_dashboard, + mock_thumbnail_cache, +): Review Comment: **Suggestion:** Add type annotations for all fixture-injected parameters and the return type on this new test function. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This new test function has multiple parameters but none of them are type annotated, and it also lacks a return annotation. That matches the rule violation for newly added Python functions that are not fully typed. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=5da05838bcfb4e299770631d8a4bbdff&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=5da05838bcfb4e299770631d8a4bbdff&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/tasks/test_thumbnails.py **Line:** 79:87 **Comment:** *Custom Rule: Add type annotations for all fixture-injected parameters and the return type on this new test function. 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=c0759102ac7ed1ea2536928cac3f22968ad716953e7abc37fbaa3f8f78662f66&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=c0759102ac7ed1ea2536928cac3f22968ad716953e7abc37fbaa3f8f78662f66&reaction=dislike'>👎</a> ########## tests/unit_tests/tasks/test_thumbnails.py: ########## @@ -0,0 +1,140 @@ +# 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. + +from unittest.mock import MagicMock, patch + +import pytest + + [email protected] +def mock_thumbnail_cache(): + with patch("superset.tasks.thumbnails.thumbnail_cache", True): + yield + + [email protected] +def mock_dashboard(): + dashboard = MagicMock() + dashboard.id = 1 + dashboard.digest = "test_digest" + return dashboard + + +def _make_screenshot_mock(cache_key: str = "test_cache_key") -> MagicMock: + screenshot = MagicMock() + screenshot.get_cache_key.return_value = cache_key + return screenshot Review Comment: **Suggestion:** Add a short docstring describing this helper's purpose to satisfy the rule requiring docstrings on newly added functions. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This newly added helper function has no docstring immediately under the definition. The rule requires docstrings for newly added Python functions and classes, so this is a real violation. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=71b3691872a14f2e815f16b83c544aad&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=71b3691872a14f2e815f16b83c544aad&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/tasks/test_thumbnails.py **Line:** 37:40 **Comment:** *Custom Rule: Add a short docstring describing this helper's purpose to satisfy the rule requiring docstrings on newly added functions. 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=a0469bf72bcc959f6dd25cee8f2e2cce425ea010e8f6a538aabffa0992ceb1c3&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=a0469bf72bcc959f6dd25cee8f2e2cce425ea010e8f6a538aabffa0992ceb1c3&reaction=dislike'>👎</a> ########## tests/unit_tests/utils/test_screenshot_cache_fix.py: ########## @@ -149,38 +153,34 @@ def test_cache_saved_only_when_image_generated( assert cached_value["status"] == "Updated" assert cached_value["image"] is not None - def test_no_intermediate_cache_during_computing( + def test_computing_status_written_to_cache_early( self, mocker: MockerFixture, screenshot_obj, mock_user ): Review Comment: **Suggestion:** Add full type hints for all parameters and the return type in this newly added test method to keep new Python code fully typed. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This is a newly added Python test method, and it omits type hints for `screenshot_obj`, `mock_user`, and the return type. The rule requires new Python code to be fully typed, so this is a real violation. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=81e32e8760a74a3b8cae83292f98b9a0&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=81e32e8760a74a3b8cae83292f98b9a0&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:** 156:158 **Comment:** *Custom Rule: Add full type hints for all parameters and the return type in this newly added test method to keep new Python code fully typed. 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=d50b6c05ba3c9462274c91d25f6ed8fa754747309226b917e10576dc04009fbb&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=d50b6c05ba3c9462274c91d25f6ed8fa754747309226b917e10576dc04009fbb&reaction=dislike'>👎</a> ########## tests/unit_tests/tasks/test_thumbnails.py: ########## @@ -0,0 +1,140 @@ +# 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. + +from unittest.mock import MagicMock, patch + +import pytest + + [email protected] +def mock_thumbnail_cache(): + with patch("superset.tasks.thumbnails.thumbnail_cache", True): + yield + + [email protected] +def mock_dashboard(): + dashboard = MagicMock() + dashboard.id = 1 + dashboard.digest = "test_digest" + return dashboard + + +def _make_screenshot_mock(cache_key: str = "test_cache_key") -> MagicMock: + screenshot = MagicMock() + screenshot.get_cache_key.return_value = cache_key + return screenshot + + +# --------------------------------------------------------------------------- +# Helpers shared across tests +# --------------------------------------------------------------------------- + +_COMMON_PATCHES = [ + "superset.tasks.thumbnails.get_executor", + "superset.tasks.thumbnails.security_manager", + "superset.tasks.thumbnails.override_user", + "superset.tasks.thumbnails.get_url_path", + "superset.tasks.thumbnails.DashboardScreenshot", +] + + +def _apply_patches(fn): Review Comment: **Suggestion:** Add parameter and return type annotations for this helper so the new function signature is fully typed. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This helper function omits both a parameter type annotation and a return type annotation. The custom rule explicitly flags new Python functions that are not fully typed. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=c04ef1c6259b45c284a87d004efb0e19&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=c04ef1c6259b45c284a87d004efb0e19&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/tasks/test_thumbnails.py **Line:** 56:56 **Comment:** *Custom Rule: Add parameter and return type annotations for this helper so the new function signature is fully typed. 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=3551dd738b73c8357b8eef99e4de49fdc863da014aace7f67f3487cc79e782e4&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=3551dd738b73c8357b8eef99e4de49fdc863da014aace7f67f3487cc79e782e4&reaction=dislike'>👎</a> ########## tests/unit_tests/utils/test_screenshot_cache_fix.py: ########## @@ -408,3 +414,33 @@ def test_stale_computing_triggers_retry( assert cached_value is not None assert cached_value["status"] == "Updated" assert cached_value["image"] is not None + + def test_concurrent_task_skips_when_lock_already_held( + self, mocker: MockerFixture, screenshot_obj, mock_user + ): Review Comment: **Suggestion:** Add explicit type annotations for `screenshot_obj`, `mock_user`, and the return type on this new method signature. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This newly added test method lacks type annotations for `screenshot_obj`, `mock_user`, and the return type. That matches the custom rule for fully typed new Python code. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=85668e158a104ffa87c810b9842a0751&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=85668e158a104ffa87c810b9842a0751&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:** 418:420 **Comment:** *Custom Rule: Add explicit type annotations for `screenshot_obj`, `mock_user`, and the return type on this new method signature. 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=3bde58a3a2f5c9ed63d95e88e505aa16c0f53aabcfebf8833fc1e0e51c721103&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=3bde58a3a2f5c9ed63d95e88e505aa16c0f53aabcfebf8833fc1e0e51c721103&reaction=dislike'>👎</a> ########## tests/unit_tests/utils/test_screenshot_cache_fix.py: ########## @@ -408,3 +414,33 @@ def test_stale_computing_triggers_retry( assert cached_value is not None assert cached_value["status"] == "Updated" assert cached_value["image"] is not None + + def test_concurrent_task_skips_when_lock_already_held( + self, mocker: MockerFixture, screenshot_obj, mock_user + ): + """compute_and_cache exits without rendering when the distributed lock + is already held by another worker — atomically preventing duplicate Selenium.""" + mock_lock = mocker.patch(DISTRIBUTED_LOCK_PATH) + mock_lock.return_value.__enter__.side_effect = ( + AcquireDistributedLockFailedException("lock held") + ) + get_screenshot = mocker.patch(BASE_SCREENSHOT_PATH + ".get_screenshot") + BaseScreenshot.cache = MockCache() + + screenshot_obj.compute_and_cache(user=mock_user, force=False) + + get_screenshot.assert_not_called() + + def test_computing_preserves_previous_image( + self, mocker: MockerFixture, screenshot_obj, mock_user + ): Review Comment: **Suggestion:** Annotate all method parameters and include an explicit return type for this new test to satisfy the typing rule for added Python code. [custom_rule] **Severity Level:** Minor ⚠️ <details> <summary><b>Why it matters? 🤔 </b></summary> This is another newly added Python test method without annotations for `screenshot_obj`, `mock_user`, or the return value. It violates the rule requiring new Python code to be fully typed. </details> [](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f204defd8150403ab1295b05c0732585&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=f204defd8150403ab1295b05c0732585&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:** 434:436 **Comment:** *Custom Rule: Annotate all method parameters and include an explicit return type for this new test to satisfy the typing rule for added Python code. 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=a3c8afe4f78ee1b502feaf13742ca53c767b21fe375d9864febe8a6497c04164&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38576&comment_hash=a3c8afe4f78ee1b502feaf13742ca53c767b21fe375d9864febe8a6497c04164&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]
