Skip to content

Commit 817fa7a

Browse files
committed
Fix ruff checks
1 parent 03f07d1 commit 817fa7a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

python/hsml/client/istio/utils/numpy_codec.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,30 @@ def to_np_dtype(dtype):
3838

3939

4040
def from_np_dtype(np_dtype):
41-
if np_dtype == bool:
41+
if np_dtype is bool:
4242
return "BOOL"
43-
elif np_dtype == np.int8:
43+
elif np_dtype is np.int8:
4444
return "INT8"
45-
elif np_dtype == np.int16:
45+
elif np_dtype is np.int16:
4646
return "INT16"
47-
elif np_dtype == np.int32:
47+
elif np_dtype is np.int32:
4848
return "INT32"
49-
elif np_dtype == np.int64:
49+
elif np_dtype is np.int64:
5050
return "INT64"
51-
elif np_dtype == np.uint8:
51+
elif np_dtype is np.uint8:
5252
return "UINT8"
53-
elif np_dtype == np.uint16:
53+
elif np_dtype is np.uint16:
5454
return "UINT16"
55-
elif np_dtype == np.uint32:
55+
elif np_dtype is np.uint32:
5656
return "UINT32"
57-
elif np_dtype == np.uint64:
57+
elif np_dtype is np.uint64:
5858
return "UINT64"
59-
elif np_dtype == np.float16:
59+
elif np_dtype is np.float16:
6060
return "FP16"
61-
elif np_dtype == np.float32:
61+
elif np_dtype is np.float32:
6262
return "FP32"
63-
elif np_dtype == np.float64:
63+
elif np_dtype is np.float64:
6464
return "FP64"
65-
elif np_dtype == np.object_ or np_dtype.type == np.bytes_:
65+
elif np_dtype is np.object_ or np_dtype.type is np.bytes_:
6666
return "BYTES"
6767
return None

python/tests/test_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ def test_extract_field_from_json_as_instance_of_list_str(self, mocker):
597597
assert b == ["2", "2", "2"]
598598
assert get_obj_from_json.call_count == 3
599599
assert get_obj_from_json.call_args[1]["obj"] == "2"
600-
assert get_obj_from_json.call_args[1]["cls"] == str
600+
assert get_obj_from_json.call_args[1]["cls"] is str
601601

602602
def test_get_obj_from_json_cls(self, mocker):
603603
# Arrange

0 commit comments

Comments
 (0)