bito-code-review[bot] commented on code in PR #41097:
URL: https://github.com/apache/superset/pull/41097#discussion_r3455596346


##########
superset/utils/screenshots.py:
##########
@@ -312,6 +312,10 @@ def compute_and_cache(  # pylint: 
disable=too-many-arguments
         if image:
             with 
event_logger.log_context(f"screenshot.cache.{self.thumbnail_type}"):
                 cache_payload.update(image)
+        elif cache_payload.status != StatusValues.ERROR:
+            # Only call error() if not already set — avoids overwriting the 
timestamp
+            # recorded when the actual failure occurred (line 302 or 308 
above).
+            cache_payload.error()

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing test for timestamp preservation</b></div>
   <div id="fix">
   
   The fix logic is sound, but add a test that captures the specific scenario: 
get_screenshot returns an image, then resize fails. Verify error() is only 
called once (at line 308) and the timestamp reflects the resize failure, not a 
later overwrite.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f070b0</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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