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

   <!-- Bito Reply -->
   The suggestion to handle `isinstance(reason, int)` in the classifier is 
appropriate. As noted, `URLError` can wrap an integer error code, which 
currently causes the classifier to misidentify the error as a generic network 
issue and lose the original HTTP status code. Adding a check for `int` in the 
`except (OSError, HTTPException)` block in 
`superset/commands/report/chart_data.py` would correctly preserve this 
diagnostic information.
   
   **superset/commands/report/chart_data.py**
   ```
   except (OSError, HTTPException) as error:
               reason = error.reason if isinstance(error, URLError) else error
               if isinstance(reason, int):
                   category, status = "http", reason
               else:
                   is_timeout = isinstance(reason, TimeoutError) or (
                       isinstance(reason, OSError) and reason.errno == 
errno.ETIMEDOUT
                   )
                   category = "timeout" if is_timeout else "network"
   ```


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