dpgaspar edited a comment on pull request #11973:
URL: 
https://github.com/apache/incubator-superset/pull/11973#issuecomment-742537007


   @john-bodley unfortunately these exceptions from sqlalchemy dialects (at SQL 
compile) do not raise any SQLAlchemy exception and SQLAlchemy does not wrap 
these up. Used `elasticsearch-dbapi` that follows the same exception pattern 
has `pydruid` and done an inpect MRO on the exception on our 
`external_metadata` method:
   
   ```
                   except Exception as ex:  # pylint: disable=broad-except
                       import inspect
                       print(f"{inspect.getmro(ex.__class__)}")
                       col["type"] = "UNKNOWN"
   ```
     
   The output:
   ```
   (<class 'es.exceptions.NotSupportedError'>,
    <class 'es.exceptions.DatabaseError'>,
    <class 'es.exceptions.Error'>,
    <class 'Exception'>, <class 'BaseException'>, <class 'object'>
   )
   ```
   
   So it seems that we are bound to catching whatever exceptions the dialects 
may raise


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

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