sonatype-lift[bot] commented on code in PR #231:
URL: https://github.com/apache/skywalking-python/pull/231#discussion_r952457676


##########
skywalking/meter/meter.py:
##########
@@ -0,0 +1,114 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+from abc import ABC, abstractmethod
+from skywalking.protocol.language_agent.Meter_pb2 import Label
+
+from enum import Enum
+
+
+class MeterType(Enum):
+    GAUGE = 1
+    COUNTER = 2
+    HISTOGRAM = 3
+
+
+class MeterTag():
+    def __init__(self, key: str, value: str):
+        self.key = key
+        self.value = value
+
+    def __lt__(self, other):
+        if self.key != other.key:
+            return self.key < other.key
+        else:
+            return self.value < other.value
+
+    def get_key(self):
+        return self.key
+
+    def get_value(self):
+        return self.value
+
+    def __hash__(self) -> int:
+        return hash((self.key, self.value))
+
+
+class MeterId():
+    def __init__(self, name: str, type, tags: list) -> None:
+        if tags is None:
+            tags = []
+
+        self.name = name
+        self.type = type
+        self.tags = tags
+        self.labels = None
+
+    def transform_tags(self):
+        if self.labels is not None:
+            return self.labels
+
+        self.labels = [Lable(tag.key, tag.value) for tag in self.tags]
+        return self.labels
+
+    def get_name(self):
+        return self.name
+
+    def get_tags(self):
+        return self.tags
+
+    def get_type(self):
+        return self.type
+
+    def __hash__(self):
+        return hash((self.name, self.type, tuple(self.tags)))
+
+
+class BaseMeter(ABC):
+    meter_service = None
+
+    def __init__(self, name: str, tags=None):
+        self.meterId = MeterId(name, self.get_type(), tags=None)

Review Comment:
   *Incompatible parameter type:*  Expected `typing.List[typing.Any]` for 3rd 
parameter `tags` to call `MeterId.__init__` but got `None`.
   
   ---
   
   Reply with *"**@sonatype-lift help**"* for info about LiftBot commands.
   Reply with *"**@sonatype-lift ignore**"* to tell LiftBot to leave out the 
above finding from this PR.
   Reply with *"**@sonatype-lift ignoreall**"* to tell LiftBot to leave out all 
the findings from this PR and from the status bar in Github.
   
   When talking to LiftBot, you need to **refresh** the page to see its 
response. [Click here](https://help.sonatype.com/lift/talking-to-lift) to get 
to know more about LiftBot commands.
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not 
relevant](https://www.sonatype.com/lift-comment-rating?comment=320477157&lift_comment_rating=1)
 ] - [ [😕 Won't 
fix](https://www.sonatype.com/lift-comment-rating?comment=320477157&lift_comment_rating=2)
 ] - [ [😑 Not critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=320477157&lift_comment_rating=3)
 ] - [ [🙂 Critical, will 
fix](https://www.sonatype.com/lift-comment-rating?comment=320477157&lift_comment_rating=4)
 ] - [ [😊 Critical, fixing 
now](https://www.sonatype.com/lift-comment-rating?comment=320477157&lift_comment_rating=5)
 ]



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

Reply via email to