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/02/14 15:36:06 UTC

[GitHub] [incubator-superset] villebro commented on a change in pull request #9138: [mypy] Enforcing typing for db_engine_specs

villebro commented on a change in pull request #9138: [mypy] Enforcing typing for db_engine_specs
URL: https://github.com/apache/incubator-superset/pull/9138#discussion_r379492319
 
 

 ##########
 File path: superset/db_engine_specs/base.py
 ##########
 @@ -486,14 +496,13 @@ def extract_error_message(cls, e: Exception) -> str:
         return f"{cls.engine} error: {cls._extract_error_message(e)}"
 
     @classmethod
-    def _extract_error_message(cls, e: Exception) -> str:
+    def _extract_error_message(cls, e: Exception) -> Optional[str]:
         """Extract error message for queries"""
         return utils.error_msg_from_exception(e)
 
     @classmethod
-    def adjust_database_uri(cls, uri, selected_schema: Optional[str]):
-        """Based on a URI and selected schema, return a new URI
-
+    def adjust_database_uri(cls, uri: URL, selected_schema: Optional[str]) -> None:
 
 Review comment:
   If memory serves me right, these wouldn't benefit from chaining in the context they're used. However, I don't oppose returning the mutated object, but in that case I'd add a note in the docstring. Also there's a `# TODO:` below that can be removed.

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


With regards,
Apache Git Services

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