Skip to content

Commit a26a6ef

Browse files
committed
Fix lint issues
1 parent 99ae2f7 commit a26a6ef

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

opentelemetry-sdk/benchmarks/metrics/test_benchmark_metrics_histogram.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ def benchmark_histogram_record_10():
7171

7272
@pytest.mark.parametrize("num_labels", [1, 3])
7373
def test_histogram_record_10_small_mapping_attrs(benchmark, num_labels):
74-
def test_histogram_record_10_complex_attrs():
74+
def test_histogram_record_10_attrs():
7575
hist10.record(
7676
random.random() * MAX_BOUND_VALUE,
7777
attributes={f"Key{i}": {"k1": "v1"} for i in range(num_labels)},
7878
)
7979

80-
benchmark(test_histogram_record_10_complex_attrs)
80+
benchmark(test_histogram_record_10_attrs)
8181

8282

8383
@pytest.mark.parametrize("num_labels", [1, 3])
8484
def test_histogram_record_10_complex_attrs(benchmark, num_labels):
85-
def test_histogram_record_10_complex_attrs():
85+
def test_histogram_record_10_attrs():
8686
hist10.record(
8787
random.random() * MAX_BOUND_VALUE,
8888
attributes={
@@ -91,12 +91,12 @@ def test_histogram_record_10_complex_attrs():
9191
},
9292
)
9393

94-
benchmark(test_histogram_record_10_complex_attrs)
94+
benchmark(test_histogram_record_10_attrs)
9595

9696

9797
@pytest.mark.parametrize("num_labels", [1, 3])
9898
def test_histogram_record_10_array_attrs(benchmark, num_labels):
99-
def test_histogram_record_10_array_attrs():
99+
def test_histogram_record_10_attrs():
100100
hist10.record(
101101
random.random() * MAX_BOUND_VALUE,
102102
attributes={
@@ -105,12 +105,12 @@ def test_histogram_record_10_array_attrs():
105105
},
106106
)
107107

108-
benchmark(test_histogram_record_10_array_attrs)
108+
benchmark(test_histogram_record_10_attrs)
109109

110110

111111
@pytest.mark.parametrize("num_labels", [1, 3])
112112
def test_histogram_record_10_json_string_attrs(benchmark, num_labels):
113-
def test_histogram_record_10_json_string_attrs():
113+
def test_histogram_record_10_attrs():
114114
hist10.record(
115115
random.random() * MAX_BOUND_VALUE,
116116
attributes={
@@ -121,7 +121,7 @@ def test_histogram_record_10_json_string_attrs():
121121
},
122122
)
123123

124-
benchmark(test_histogram_record_10_json_string_attrs)
124+
benchmark(test_histogram_record_10_attrs)
125125

126126

127127
@pytest.mark.parametrize("num_labels", [0, 1, 3, 5, 7])

opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/_view_instrument_match.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
def _hash_attributes(value: Attributes | AttributeValue) -> _HashedAttributes:
3232
if value is None or isinstance(value, (str, int, float, bool, bytes)):
3333
return value
34-
elif isinstance(value, Sequence):
34+
if isinstance(value, Sequence):
3535
return tuple(_hash_attributes(v) for v in value)
36-
elif isinstance(value, Mapping):
36+
if isinstance(value, Mapping):
3737
return tuple((k, _hash_attributes(value[k])) for k in sorted(value))
3838
raise TypeError(f"Invalid value type for attributes: {type(value)}")
3939

0 commit comments

Comments
 (0)