mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 03:08:48 +08:00
[Metrics] Use isinstance for type-checking keys of tags for metrics (#11202)
* Use isinstance instead of type for type-checking keys of tags for metrics * Fix lint error
This commit is contained in:
@@ -37,10 +37,9 @@ class Metric:
|
||||
# The Cython metric class. This should be set in the child class.
|
||||
self._metric = None
|
||||
|
||||
if type(self._tag_keys) != tuple:
|
||||
raise ValueError(
|
||||
"tag_keys should be a tuple type, "
|
||||
f"but {type(self._tag_keys)} type was specified instead.")
|
||||
if not isinstance(self._tag_keys, tuple):
|
||||
raise ValueError("tag_keys should be a tuple type, got: "
|
||||
f"{type(self._tag_keys)}")
|
||||
|
||||
def set_default_tags(self, default_tags: Dict[str, str]):
|
||||
"""Set default tags of metrics.
|
||||
|
||||
Reference in New Issue
Block a user