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/03/29 21:14:47 UTC

[GitHub] [incubator-superset] john-bodley commented on a change in pull request #9416: [mypy] Enforcing typing for some modules

john-bodley commented on a change in pull request #9416: [mypy] Enforcing typing for some modules
URL: https://github.com/apache/incubator-superset/pull/9416#discussion_r399854850
 
 

 ##########
 File path: superset/stats_logger.py
 ##########
 @@ -24,26 +24,26 @@
 class BaseStatsLogger:
     """Base class for logging realtime events"""
 
-    def __init__(self, prefix="superset"):
+    def __init__(self, prefix: str = "superset") -> None:
         self.prefix = prefix
 
-    def key(self, key):
+    def key(self, key: str) -> str:
         if self.prefix:
             return self.prefix + key
         return key
 
-    def incr(self, key):
+    def incr(self, key: str) -> None:
         """Increment a counter"""
         raise NotImplementedError()
 
-    def decr(self, key):
+    def decr(self, key: str) -> None:
         """Decrement a counter"""
         raise NotImplementedError()
 
-    def timing(self, key, value):
+    def timing(self, key, value: float) -> None:
         raise NotImplementedError()
 
-    def gauge(self, key):
+    def gauge(self, key: str, value: int) -> None:
 
 Review comment:
   This was missing the gauge value. It's  hard to tell from the statsD code whether this should be an `int`, `float` , or `both`. 

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