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


##########
superset/tasks/async_queries.py:
##########
@@ -121,11 +134,26 @@ def load_chart_data_into_cache(
             async_query_manager.update_job(
                 job_metadata, async_query_manager.STATUS_ERROR, errors=errors
             )
+            attempt = self.request.retries + 1
+            logger.warning(
+                "Retrying load_chart_data_into_cache (attempt {%s}): {%s}",
+                attempt,
+                ex,
+            )

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Logging format string bug</b></div>
   <div id="fix">
   
   The `logger.warning` calls use Python f-string/format style placeholders 
(`{%s}`) instead of %-style. Python's logging module treats `{}` as literal 
characters, so the log will output the raw `{%s}` instead of the actual values. 
Change `{%s}` to `%s` on both lines 139 and 228.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- a/superset/tasks/async_queries.py
    +++ b/superset/tasks/async_queries.py
    @@ -136,7 +136,7 @@ def load_chart_data_into_cache(
                 )
                 attempt = self.request.retries + 1
                 logger.warning(
    -                "Retrying load_chart_data_into_cache (attempt {%s}): {%s}",
    +                "Retrying load_chart_data_into_cache (attempt %s): %s",
                     attempt,
                     ex,
                 )
    @@ -225,7 +225,7 @@ def load_explore_json_into_cache(
                 )
                 attempt = self.request.retries + 1
                 logger.warning(
    -                "Retrying load_explore_json_into_cache (attempt {%s}): 
{%s}",
    +                "Retrying load_explore_json_into_cache (attempt %s): %s",
                     attempt,
                     ex,
                 )
                 raise
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #2ca2f0</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