Skip to content

Commit

Permalink
typing strikes again
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly committed Sep 11, 2024
1 parent efa6948 commit f9b2e33
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cockpit/channels/pcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
import sys
import time
from collections import defaultdict
from typing import TYPE_CHECKING, Any, Iterable, List, NamedTuple, Optional, Sequence
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, NamedTuple, Optional, Sequence

from cockpit.protocol import CockpitProblem

Expand All @@ -92,7 +92,7 @@ class MetricNotFoundError(CockpitProblem):
pass


class PcpMetricInfo(dict[str, JsonValue]):
class PcpMetricInfo(Dict[str, JsonValue]):
def __init__(self, value: JsonObject) -> None:
self.name = get_str(value, 'name')
self.derive = get_str(value, 'derive', '')
Expand Down Expand Up @@ -466,11 +466,11 @@ def sample(self, context: 'pmapi.pmContext', archive_batch: int, limit: int, tot

def parse_fetched_results(self, context: 'pmapi.pmContext', results: Any) -> Any:
metrics = list(self.metrics)
samples: dict[str, float | list[float]] = {}
samples: Dict[str, float | list[float]] = {}

samples['timestamp'] = float(results.contents.timestamp)
for i in range(results.contents.numpmid):
values: Optional[dict[str, float] | float] = defaultdict()
values: Optional[Dict[str, float] | float] = defaultdict()
numval: int = results.contents.get_numval(i)
metric_desc = self.metric_descriptions[i]
content_type = metric_desc.desc.type
Expand Down

0 comments on commit f9b2e33

Please sign in to comment.