You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "carlosribeiro-plaid (via GitHub)" <gi...@apache.org> on 2026/06/29 12:52:53 UTC

[PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

carlosribeiro-plaid opened a new pull request, #41530:
URL: https://github.com/apache/superset/pull/41530

   ### SUMMARY
   
   `superset compute-thumbnails` crashes with `DetachedInstanceError` when more than one model is processed (e.g. `superset compute-thumbnails -d -i 8 -i 12`).
   
   `compute_generic_thumbnail` queries the models, then inside the loop builds the progress message with an f-string that interpolates the ORM instance (`f'... "{model}" ...'`). Computing a thumbnail (`cache_dashboard_thumbnail` / `cache_chart_thumbnail`) can close/expire the SQLAlchemy session, so on the next iteration the instance is detached and `str(model)` raises:
   
   ```
   sqlalchemy.orm.exc.DetachedInstanceError: Instance <Dashboard at 0x...> is not bound to a Session; attribute refresh operation cannot proceed
   ```
   
   The fix materializes the `(id, label)` pairs up front, before any thumbnail is computed, then iterates over plain values — so the loop never touches a detached ORM instance. No behavior change otherwise.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (CLI bug fix).
   
   ### TESTING INSTRUCTIONS
   
   1. With thumbnails enabled, run `superset compute-thumbnails -d -i <id1> -i <id2>` (two or more ids).
   2. Before: it processes the first model, then crashes with `DetachedInstanceError`.
   3. After: all requested models are processed.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #41530:
URL: https://github.com/apache/superset/pull/41530


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4835284499

   <!-- Bito Reply -->
   The suggestion to add explicit type annotations is correct and improves code readability and maintainability. You can resolve this by adding the following type hints to the variables in `superset/cli/thumbnails.py`:
   
   ```python
           items: list[tuple[int, str]] = [(model.id, str(model)) for model in query.all()]
           count: int = len(items)
           if asynchronous:
               func: Callable = compute_func.delay
               action: str = "Triggering"
           else:
               func: Callable = compute_func
               action: str = "Processing"
   ```
   
   There are no other comments on this PR. Would you like me to check for any other potential type-hinting improvements in this file?
   
   **superset/cli/thumbnails.py**
   ```
   items: list[tuple[int, str]] = [(model.id, str(model)) for model in query.all()]
           count: int = len(items)
           if asynchronous:
               func: Callable = compute_func.delay
               action: str = "Triggering"
           else:
               func: Callable = compute_func
               action: str = "Processing"
   ```


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4835261213

   <!-- translation-regression-bot -->
   ## ⚠️ Translation Regression Detected
   
   A source change in this PR renamed or reworded strings, invalidating existing translations (they are now `#, fuzzy`) in `fi`, `th`. Please resolve the affected `.po` files before merging.
   
   _Note: intentionally **deleting** a translatable string is not a regression and is not flagged here — only translations invalidated by a renamed/reworded source string are._
   
   | Language | Fuzzy before | Fuzzy after | New |
   |----------|-------------:|------------:|----:|
   | `fi` | 4809 | 4811 | +2 |
   | `th` | 4809 | 4811 | +2 |
   
   ### How to fix
   
   **1. Install dependencies** (if not already set up):
   
   ```bash
   pip install -r superset/translations/requirements.txt
   sudo apt-get install gettext   # or: brew install gettext
   ```
   
   **2. Re-extract strings and sync `.po` files:**
   
   ```bash
   ./scripts/translations/babel_update.sh
   ```
   
   This rewrites `superset/translations/messages.pot` from the current source files and merges the changes into every `.po` file. Strings whose `msgid` changed will be marked `#, fuzzy`.
   
   **3. Resolve the fuzzy entries** in the affected language files (`fi`, `th`):
   
   ```bash
   grep -n '#, fuzzy' superset/translations/<lang>/LC_MESSAGES/messages.po
   ```
   
   For each fuzzy entry, either rewrite the `msgstr` to match the new string and remove the `#, fuzzy` line, or clear the `msgstr` to `""` if you cannot provide a translation.
   
   **4. Commit your changes to the `.po` files.**
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #41530:
URL: https://github.com/apache/superset/pull/41530#discussion_r3498621188


##########
tests/unit_tests/cli/thumbnails_test.py:
##########
@@ -0,0 +1,79 @@
+# 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 click.testing import CliRunner
+from pytest_mock import MockerFixture
+
+from superset.cli import thumbnails
+
+
+class _FakeModel:
+    """Stand-in for a Dashboard/Slice that detaches mid-run.
+
+    Once ``detached`` is set, ``str()`` raises -- mimicking the
+    DetachedInstanceError that SQLAlchemy raises when the session that
+    loaded the instance has been closed/expired.
+    """
+
+    def __init__(self, pk: int, label: str) -> None:
+        self.id = pk
+        self._label = label
+        self.detached = False

Review Comment:
   **Suggestion:** Add explicit type annotations for the instance attributes in the initializer so the new class fully complies with the type-hinting rule. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new class defines instance attributes in Python without annotations even though their types are clear and can be annotated. This matches the type-hinting rule for relevant variables in newly introduced Python code.
   </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=0e03d33568ce4e4ba3bf650d8a387237&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=0e03d33568ce4e4ba3bf650d8a387237&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/cli/thumbnails_test.py
   **Line:** 31:34
   **Comment:**
   	*Custom Rule: Add explicit type annotations for the instance attributes in the initializer so the new class fully complies with the type-hinting 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%2F41530&comment_hash=7b2ea6e78400d297eaa91184195b674a8c66de7682fdd0d69bb3523d11fe2c41&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41530&comment_hash=7b2ea6e78400d297eaa91184195b674a8c66de7682fdd0d69bb3523d11fe2c41&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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4845130562

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4931970474

   **Bito Automatic Review Skipped – PR Already Merged**<br/><br/>Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.<br/>No action is needed if you didn't intend to review it. To get a review, you can type `/review` in a comment and save it


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #41530:
URL: https://github.com/apache/superset/pull/41530#discussion_r3506097459


##########
superset/cli/thumbnails.py:
##########
@@ -82,18 +83,23 @@ def compute_generic_thumbnail(
         query = db.session.query(model_cls)
         if model_ids:
             query = query.filter(model_cls.id.in_(model_ids))
-        dashboards = query.all()
-        count = len(dashboards)
-        for i, model in enumerate(dashboards):
-            if asynchronous:
-                func = compute_func.delay
-                action = "Triggering"
-            else:
-                func = compute_func
-                action = "Processing"
-            msg = f'{action} {friendly_type} "{model}" ({i + 1}/{count})'
+        # Materialize the id and label up front. Computing a thumbnail below can
+        # close/expire the session, which detaches the ORM instances and makes
+        # str(model) raise DetachedInstanceError on subsequent iterations.
+        items: list[tuple[int, str]] = [(model.id, str(model)) for model in query.all()]
+        count: int = len(items)
+        func: Callable[..., Any]
+        action: str
+        if asynchronous:
+            func = compute_func.delay
+            action = "Triggering"
+        else:
+            func = compute_func
+            action = "Processing"
+        for i, (model_pk, label) in enumerate(items):
+            msg = f'{action} {friendly_type} "{label}" ({i + 1}/{count})'

Review Comment:
   **Suggestion:** Add an explicit type annotation for this newly introduced local variable to comply with the rule requiring type hints on relevant annotatable variables. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly introduced local variable that can clearly be annotated as `str`, but it is assigned without a type hint. That matches the rule requiring type hints on relevant annotatable variables.
   </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=da192180d4664decb1267e7ffb8ff862&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=da192180d4664decb1267e7ffb8ff862&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/cli/thumbnails.py
   **Line:** 100:100
   **Comment:**
   	*Custom Rule: Add an explicit type annotation for this newly introduced local variable to comply with the rule requiring type hints on relevant annotatable variables.
   
   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%2F41530&comment_hash=d77dac5360b6a8c354c7c655c28a920ae4e745ade53e553bc2176ce6b4b16866&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41530&comment_hash=d77dac5360b6a8c354c7c655c28a920ae4e745ade53e553bc2176ce6b4b16866&reaction=dislike'>👎</a>



##########
tests/unit_tests/cli/thumbnails_test.py:
##########
@@ -0,0 +1,79 @@
+# 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 click.testing import CliRunner
+from pytest_mock import MockerFixture
+
+from superset.cli import thumbnails
+
+
+class _FakeModel:
+    """Stand-in for a Dashboard/Slice that detaches mid-run.
+
+    Once ``detached`` is set, ``str()`` raises -- mimicking the
+    DetachedInstanceError that SQLAlchemy raises when the session that
+    loaded the instance has been closed/expired.
+    """
+
+    def __init__(self, pk: int, label: str) -> None:
+        self.id: int = pk
+        self._label: str = label
+        self.detached: bool = False
+
+    def __str__(self) -> str:
+        if self.detached:
+            raise RuntimeError("Instance is not bound to a Session (simulated)")
+        return self._label
+
+
+def test_compute_thumbnails_survives_detached_instances(
+    mocker: MockerFixture, app_context: None
+) -> None:
+    """Regression test for the DetachedInstanceError in compute-thumbnails.
+
+    Computing a thumbnail can close/expire the session, detaching the ORM
+    instances. The command must read each model's id and label *before* the
+    compute loop, so building the progress message never touches a detached
+    instance even when several models are processed.
+    """
+    models = [_FakeModel(1, "Dashboard A"), _FakeModel(2, "Dashboard B")]

Review Comment:
   **Suggestion:** Add an explicit type annotation for this local collection variable to satisfy the type-hinting requirement for relevant variables. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The new code introduces a local collection variable without an explicit type hint, and the rule requires type hints on relevant Python variables that can be annotated. This is a real omission in the added code.
   </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=60aeac47d71a42c980fc90d5e3492b16&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=60aeac47d71a42c980fc90d5e3492b16&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/cli/thumbnails_test.py
   **Line:** 52:52
   **Comment:**
   	*Custom Rule: Add an explicit type annotation for this local collection variable to satisfy the type-hinting requirement for relevant variables.
   
   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%2F41530&comment_hash=43d054f9b90d68e4571547d5d49795f5144089fe355320d73a237d73ad0eb637&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41530&comment_hash=43d054f9b90d68e4571547d5d49795f5144089fe355320d73a237d73ad0eb637&reaction=dislike'>👎</a>



##########
tests/unit_tests/cli/thumbnails_test.py:
##########
@@ -0,0 +1,79 @@
+# 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 click.testing import CliRunner
+from pytest_mock import MockerFixture
+
+from superset.cli import thumbnails
+
+
+class _FakeModel:
+    """Stand-in for a Dashboard/Slice that detaches mid-run.
+
+    Once ``detached`` is set, ``str()`` raises -- mimicking the
+    DetachedInstanceError that SQLAlchemy raises when the session that
+    loaded the instance has been closed/expired.
+    """
+
+    def __init__(self, pk: int, label: str) -> None:
+        self.id: int = pk
+        self._label: str = label
+        self.detached: bool = False
+
+    def __str__(self) -> str:
+        if self.detached:
+            raise RuntimeError("Instance is not bound to a Session (simulated)")
+        return self._label
+
+
+def test_compute_thumbnails_survives_detached_instances(
+    mocker: MockerFixture, app_context: None
+) -> None:
+    """Regression test for the DetachedInstanceError in compute-thumbnails.
+
+    Computing a thumbnail can close/expire the session, detaching the ORM
+    instances. The command must read each model's id and label *before* the
+    compute loop, so building the progress message never touches a detached
+    instance even when several models are processed.
+    """
+    models = [_FakeModel(1, "Dashboard A"), _FakeModel(2, "Dashboard B")]
+
+    query = mocker.MagicMock()

Review Comment:
   **Suggestion:** Add a type annotation to this mock variable so the new code does not omit type hints on relevant local variables. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The mock variable is newly introduced and has no explicit type hint. Since the rule flags relevant variables that can be annotated, this is a valid type-hint omission.
   </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=3a7e45ee5b4e4a978c13a7a31bb1b1b7&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=3a7e45ee5b4e4a978c13a7a31bb1b1b7&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/cli/thumbnails_test.py
   **Line:** 54:54
   **Comment:**
   	*Custom Rule: Add a type annotation to this mock variable so the new code does not omit type hints on relevant local variables.
   
   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%2F41530&comment_hash=48502022b080f3be7e4552653c0021bd7aa681aa1f300b50af8747c2d1cc2faf&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41530&comment_hash=48502022b080f3be7e4552653c0021bd7aa681aa1f300b50af8747c2d1cc2faf&reaction=dislike'>👎</a>



##########
tests/unit_tests/cli/thumbnails_test.py:
##########
@@ -0,0 +1,79 @@
+# 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 click.testing import CliRunner
+from pytest_mock import MockerFixture
+
+from superset.cli import thumbnails
+
+
+class _FakeModel:
+    """Stand-in for a Dashboard/Slice that detaches mid-run.
+
+    Once ``detached`` is set, ``str()`` raises -- mimicking the
+    DetachedInstanceError that SQLAlchemy raises when the session that
+    loaded the instance has been closed/expired.
+    """
+
+    def __init__(self, pk: int, label: str) -> None:
+        self.id: int = pk
+        self._label: str = label
+        self.detached: bool = False
+
+    def __str__(self) -> str:
+        if self.detached:
+            raise RuntimeError("Instance is not bound to a Session (simulated)")
+        return self._label
+
+
+def test_compute_thumbnails_survives_detached_instances(
+    mocker: MockerFixture, app_context: None
+) -> None:
+    """Regression test for the DetachedInstanceError in compute-thumbnails.
+
+    Computing a thumbnail can close/expire the session, detaching the ORM
+    instances. The command must read each model's id and label *before* the
+    compute loop, so building the progress message never touches a detached
+    instance even when several models are processed.
+    """
+    models = [_FakeModel(1, "Dashboard A"), _FakeModel(2, "Dashboard B")]
+
+    query = mocker.MagicMock()
+    query.filter.return_value = query
+    query.all.return_value = models
+    db_mock = mocker.patch("superset.cli.thumbnails.db")
+    db_mock.session.query.return_value = query
+
+    def _detach_session(_url: object, _model_id: int, force: bool) -> None:
+        # Computing a thumbnail expires the session -> every instance detaches.
+        for model in models:
+            model.detached = True
+
+    cache_dashboard = mocker.patch(
+        "superset.tasks.thumbnails.cache_dashboard_thumbnail",
+        side_effect=_detach_session,
+    )
+
+    result = CliRunner().invoke(thumbnails.compute_thumbnails, ["-d"])

Review Comment:
   **Suggestion:** Add a type annotation for this command invocation result variable to comply with the type-hint rule for relevant variables. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The invocation result is stored in a new local variable without a type hint. Under the stated rule, this is a valid omission because the variable can be annotated.
   </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=2d098142c77e4b8084369e2ff721e4bd&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=2d098142c77e4b8084369e2ff721e4bd&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/cli/thumbnails_test.py
   **Line:** 70:70
   **Comment:**
   	*Custom Rule: Add a type annotation for this command invocation result variable to comply with the type-hint rule for relevant variables.
   
   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%2F41530&comment_hash=4dcefe10600c8b992874b21df7fa5bff44968a99e89c7857d6ab71df2172e6cb&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41530&comment_hash=4dcefe10600c8b992874b21df7fa5bff44968a99e89c7857d6ab71df2172e6cb&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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4843339299

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 1bb1d192331c3a97692e87f881deb7a4d05678d2 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a43b34cdd7faf0007b4fbfb |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-41530--superset-docs-preview.netlify.app](https://deploy-preview-41530--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQxNTMwLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.0geQhZxIwt2qQG41Ws9ytS6Lq_TypbO2OfFyEd2BRjQ)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DYtBCoQwDAD_krOFgmUFf-AzkiahBa1FIyiyfze3YZh5oR_71g1mgAHowJaLs9Y7ZPeXSbBybdSwrmdgMcxFONR2mqfiD0tf92dhv36YRhpTZp4UNcY4UVJSgv8H) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-41530--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4836083895

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/41530?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `0%` with `10 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 55.80%. Comparing base ([`11a4a17`](https://app.codecov.io/gh/apache/superset/commit/11a4a17dffc7b082570cd0d5068b7ab262047320?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`fc17cab`](https://app.codecov.io/gh/apache/superset/commit/fc17cab8957202bdb2553a25baac3ca8c560b055?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 9 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/41530?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/cli/thumbnails.py](https://app.codecov.io/gh/apache/superset/pull/41530?src=pr&el=tree&filepath=superset%2Fcli%2Fthumbnails.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY2xpL3RodW1ibmFpbHMucHk=) | 0.00% | [10 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/41530?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (11a4a17) and HEAD (fc17cab). Click for more details.
   > 
   > <details><summary>HEAD has 12 uploads less than BASE</summary>
   >
   >| Flag | BASE (11a4a17) | HEAD (fc17cab) |
   >|------|------|------|
   >|python|12|1|
   >|presto|2|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #41530      +/-   ##
   ==========================================
   - Coverage   64.60%   55.80%   -8.81%     
   ==========================================
     Files        2664     2664              
     Lines      146411   146374      -37     
     Branches    33855    33842      -13     
   ==========================================
   - Hits        94593    81688   -12905     
   - Misses      50099    63946   +13847     
   + Partials     1719      740     -979     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.79% <0.00%> (ø)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.79% <0.00%> (-18.68%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/41530/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/41530?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4857543270

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4832814827

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #41530:
URL: https://github.com/apache/superset/pull/41530#discussion_r3493571969


##########
superset/cli/thumbnails.py:
##########
@@ -82,18 +82,21 @@ def compute_generic_thumbnail(
         query = db.session.query(model_cls)
         if model_ids:
             query = query.filter(model_cls.id.in_(model_ids))
-        dashboards = query.all()
-        count = len(dashboards)
-        for i, model in enumerate(dashboards):
-            if asynchronous:
-                func = compute_func.delay
-                action = "Triggering"
-            else:
-                func = compute_func
-                action = "Processing"
-            msg = f'{action} {friendly_type} "{model}" ({i + 1}/{count})'
+        # Materialize the id and label up front. Computing a thumbnail below can
+        # close/expire the session, which detaches the ORM instances and makes
+        # str(model) raise DetachedInstanceError on subsequent iterations.
+        items = [(model.id, str(model)) for model in query.all()]
+        count = len(items)
+        if asynchronous:
+            func = compute_func.delay
+            action = "Triggering"
+        else:
+            func = compute_func
+            action = "Processing"

Review Comment:
   **Suggestion:** Add explicit type annotations for the newly introduced local variables to comply with the type-hinting requirement. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The added local variables `items`, `count`, `func`, and `action` are all inferred from context and can be explicitly annotated, so this matches the type-hinting rule for newly introduced Python code without type hints.
   </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=b6a11c4d9567455e9dc0d462686e1e7e&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=b6a11c4d9567455e9dc0d462686e1e7e&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/cli/thumbnails.py
   **Line:** 88:95
   **Comment:**
   	*Custom Rule: Add explicit type annotations for the newly introduced local variables to comply with the type-hinting requirement.
   
   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%2F41530&comment_hash=a8157171f6d45b8c7b0040aec26bb50438cc80cff749c3c4e92b908d99d1bcda&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41530&comment_hash=a8157171f6d45b8c7b0040aec26bb50438cc80cff749c3c4e92b908d99d1bcda&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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(cli): avoid DetachedInstanceError in compute-thumbnails [superset]

Posted by "rad-pat (via GitHub)" <gi...@apache.org>.
rad-pat commented on PR #41530:
URL: https://github.com/apache/superset/pull/41530#issuecomment-4835593783

   @rusackas as requested 


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org