You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/09/22 14:32:10 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #10978: fix: changed several pylint checks in dashboard module

dpgaspar commented on a change in pull request #10978:
URL: https://github.com/apache/incubator-superset/pull/10978#discussion_r492783244



##########
File path: superset/databases/utils.py
##########
@@ -44,7 +44,7 @@ def get_indexes_metadata(
 def get_col_type(col: Dict[Any, Any]) -> str:
     try:
         dtype = f"{col['type']}"
-    except Exception:  # pylint: disable=broad-except
+    except KeyError:

Review comment:
       Actually I think this one may be trickier. I was staring at this and wondering why a `KeyError` is raised and on the exception handling we are trying to access the same key again with `col["type"].__class__.__name__`. So the exception KeyError makes sense, because it may be possible, but what we are catching is a serialisation problem, `# sqla.types.JSON __str__ has a bug, so using __class__.` 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org