Skip to content

Commit c73fd39

Browse files
authored
Merge branch 'main' into name
2 parents 46d759b + 1dd1855 commit c73fd39

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
([#2720](https://github.com/open-telemetry/opentelemetry-python/pull/2720))
1616
- Specify worker thread names
1717
([#2724](https://github.com/open-telemetry/opentelemetry-python/pull/2724))
18+
- Loosen dependency on `backoff` for newer Python versions
19+
([#2726](https://github.com/open-telemetry/opentelemetry-python/pull/2726))
20+
- fix: frozenset object has no attribute items
21+
([#2727](https://github.com/open-telemetry/opentelemetry-python/pull/2727))
1822

1923
## [1.12.0rc1-0.31b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc1-0.31b0) - 2022-05-17
2024

exporter/opentelemetry-exporter-otlp-proto-grpc/setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ install_requires =
4545
opentelemetry-api ~= 1.3
4646
opentelemetry-sdk ~= 1.11
4747
opentelemetry-proto == 1.12.0rc1
48-
backoff >= 1.10.0, < 2.0.0
48+
backoff >= 1.10.0, < 2.0.0; python_version<'3.7'
49+
backoff >= 1.10.0, < 3.0.0; python_version>='3.7'
4950

5051
[options.extras_require]
5152
test =

exporter/opentelemetry-exporter-otlp-proto-http/setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ install_requires =
4545
opentelemetry-api ~= 1.3
4646
opentelemetry-sdk ~= 1.11
4747
opentelemetry-proto == 1.12.0rc1
48-
backoff >= 1.10.0, < 2.0.0
48+
backoff >= 1.10.0, < 2.0.0; python_version<'3.7'
49+
backoff >= 1.10.0, < 3.0.0; python_version>='3.7'
4950

5051
[options.extras_require]
5152
test =

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ def consume_measurement(self, measurement: Measurement) -> None:
9595
else:
9696
attributes = {}
9797

98-
attributes = frozenset(attributes.items())
98+
aggr_key = frozenset(attributes.items())
9999

100-
if attributes not in self._attributes_aggregation:
100+
if aggr_key not in self._attributes_aggregation:
101101
with self._lock:
102-
if attributes not in self._attributes_aggregation:
102+
if aggr_key not in self._attributes_aggregation:
103103
if not isinstance(
104104
self._view._aggregation, DefaultAggregation
105105
):
@@ -118,9 +118,9 @@ def consume_measurement(self, measurement: Measurement) -> None:
118118
attributes,
119119
self._start_time_unix_nano,
120120
)
121-
self._attributes_aggregation[attributes] = aggregation
121+
self._attributes_aggregation[aggr_key] = aggregation
122122

123-
self._attributes_aggregation[attributes].aggregate(measurement)
123+
self._attributes_aggregation[aggr_key].aggregate(measurement)
124124

125125
def collect(
126126
self,

opentelemetry-sdk/tests/metrics/test_view_instrument_match.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def test_collect(self):
209209

210210
number_data_point = number_data_points[0]
211211

212-
self.assertEqual(number_data_point.attributes, frozenset({("c", "d")}))
212+
self.assertEqual(number_data_point.attributes, {"c": "d"})
213213
self.assertEqual(number_data_point.value, 0)
214214

215215
def test_setting_aggregation(self):

0 commit comments

Comments
 (0)