Skip to content

Commit

Permalink
chore: better typing
Browse files Browse the repository at this point in the history
  • Loading branch information
albertodonato committed Jan 2, 2025
1 parent 4981404 commit 7c3176e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions query_exporter/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
Connection,
CursorResult,
Engine,
Row,
)
from sqlalchemy.exc import (
ArgumentError,
Expand Down Expand Up @@ -159,7 +158,7 @@ class QueryResults(t.NamedTuple):
"""Results of a database query."""

keys: list[str]
rows: Sequence[Row[t.Any]]
rows: Sequence[Sequence[t.Any]]
timestamp: float | None = None
latency: float | None = None

Expand All @@ -168,7 +167,7 @@ def from_result(cls, result: CursorResult[t.Any]) -> t.Self:
"""Return a QueryResults from results for a query."""
timestamp = time()
keys: list[str] = []
rows: Sequence[Row[t.Any]] = []
rows: Sequence[Sequence[t.Any]] = []
if result.returns_rows:
keys, rows = list(result.keys()), result.all()
latency = result.connection.info.get("query_latency", None)
Expand Down

0 comments on commit 7c3176e

Please sign in to comment.