bito-code-review[bot] commented on PR #42120:
URL: https://github.com/apache/superset/pull/42120#issuecomment-5007180357

   <!-- Bito Reply -->
   The warning message can be updated to better reflect that an error payload 
is being cached, and the logic can be adjusted to avoid redundant warnings when 
the status is already set to ERROR. You can modify the `else` block in 
`compute_and_cache` to check the current status before logging the warning.
   
   ```python
                   else:
                       if invalid_reason and cache_payload.status != 
StatusValues.ERROR:
                           logger.warning(
                               "Caching error payload for %s: %s image payload",
                               cache_key,
                               invalid_reason,
                           )
                       if cache_payload.status != StatusValues.ERROR:
                           cache_payload.error()
   ```
   
   **superset/utils/screenshots.py**
   ```
   else:
                       if invalid_reason and cache_payload.status != 
StatusValues.ERROR:
                           logger.warning(
                               "Caching error payload for %s: %s image payload",
                               cache_key,
                               invalid_reason,
                           )
                       if cache_payload.status != StatusValues.ERROR:
                           cache_payload.error()
   ```


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