Skip to content

Commit dc8a8e5

Browse files
authored
ref: Properly override parent func (#5283)
The arg is called `item` in the parent batcher class. Doesn't really change anything functionality wise, but let's be properly generic.
1 parent 485aa6d commit dc8a8e5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

sentry_sdk/_metrics_batcher.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ class MetricsBatcher(Batcher["Metric"]):
1818
CONTENT_TYPE = "application/vnd.sentry.items.trace-metric+json"
1919

2020
@staticmethod
21-
def _to_transport_format(metric: "Metric") -> "Any":
21+
def _to_transport_format(item: "Metric") -> "Any":
2222
res = {
23-
"timestamp": metric["timestamp"],
24-
"trace_id": metric["trace_id"],
25-
"name": metric["name"],
26-
"type": metric["type"],
27-
"value": metric["value"],
23+
"timestamp": item["timestamp"],
24+
"trace_id": item["trace_id"],
25+
"name": item["name"],
26+
"type": item["type"],
27+
"value": item["value"],
2828
"attributes": {
29-
k: serialize_attribute(v) for (k, v) in metric["attributes"].items()
29+
k: serialize_attribute(v) for (k, v) in item["attributes"].items()
3030
},
3131
}
3232

33-
if metric.get("span_id") is not None:
34-
res["span_id"] = metric["span_id"]
33+
if item.get("span_id") is not None:
34+
res["span_id"] = item["span_id"]
3535

36-
if metric.get("unit") is not None:
37-
res["unit"] = metric["unit"]
36+
if item.get("unit") is not None:
37+
res["unit"] = item["unit"]
3838

3939
return res
4040

0 commit comments

Comments
 (0)