Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ad595d5

Browse files
committedApr 1, 2025·
Chore: Updated references using pyupgrade
1 parent ff9f417 commit ad595d5

File tree

108 files changed

+287
-257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+287
-257
lines changed
 

‎exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/__init__.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import re
1717
from collections import defaultdict
1818
from itertools import chain
19-
from typing import Dict, Mapping, Sequence
19+
from typing import Dict
20+
from collections.abc import Mapping, Sequence
2021

2122
import requests
2223
import snappy
@@ -71,14 +72,14 @@ class PrometheusRemoteWriteMetricsExporter(MetricExporter):
7172
def __init__(
7273
self,
7374
endpoint: str,
74-
basic_auth: Dict = None,
75-
headers: Dict = None,
75+
basic_auth: dict = None,
76+
headers: dict = None,
7677
timeout: int = 30,
77-
tls_config: Dict = None,
78-
proxies: Dict = None,
78+
tls_config: dict = None,
79+
proxies: dict = None,
7980
resources_as_labels: bool = True,
80-
preferred_temporality: Dict[type, AggregationTemporality] = None,
81-
preferred_aggregation: Dict = None,
81+
preferred_temporality: dict[type, AggregationTemporality] = None,
82+
preferred_aggregation: dict = None,
8283
):
8384
self.endpoint = endpoint
8485
self.basic_auth = basic_auth
@@ -115,7 +116,7 @@ def basic_auth(self):
115116
return self._basic_auth
116117

117118
@basic_auth.setter
118-
def basic_auth(self, basic_auth: Dict):
119+
def basic_auth(self, basic_auth: dict):
119120
if basic_auth:
120121
if "username" not in basic_auth:
121122
raise ValueError("username required in basic_auth")
@@ -147,7 +148,7 @@ def tls_config(self):
147148
return self._tls_config
148149

149150
@tls_config.setter
150-
def tls_config(self, tls_config: Dict):
151+
def tls_config(self, tls_config: dict):
151152
if tls_config:
152153
new_config = {}
153154
if "ca_file" in tls_config:
@@ -170,15 +171,15 @@ def proxies(self):
170171
return self._proxies
171172

172173
@proxies.setter
173-
def proxies(self, proxies: Dict):
174+
def proxies(self, proxies: dict):
174175
self._proxies = proxies
175176

176177
@property
177178
def headers(self):
178179
return self._headers
179180

180181
@headers.setter
181-
def headers(self, headers: Dict):
182+
def headers(self, headers: dict):
182183
self._headers = headers
183184

184185
def export(
@@ -355,7 +356,7 @@ def _build_message(timeseries: Sequence[TimeSeries]) -> bytes:
355356
serialized_message = write_request.SerializeToString()
356357
return snappy.compress(serialized_message)
357358

358-
def _build_headers(self) -> Dict:
359+
def _build_headers(self) -> dict:
359360
headers = {
360361
"Content-Encoding": "snappy",
361362
"Content-Type": "application/x-protobuf",
@@ -367,7 +368,7 @@ def _build_headers(self) -> Dict:
367368
return headers
368369

369370
def _send_message(
370-
self, message: bytes, headers: Dict
371+
self, message: bytes, headers: dict
371372
) -> MetricExportResult:
372373
auth = None
373374
if self.basic_auth:

‎exporter/opentelemetry-exporter-prometheus-remote-write/src/opentelemetry/exporter/prometheus_remote_write/gen/gogoproto/gogo_pb2.py

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.