mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
typing: Amend inaccurate type annotations.
This amend some type annotations that turn out to be inaccurate with django-stubs.
This commit is contained in:
@@ -5,7 +5,7 @@ from typing import Any, Dict, List, Optional, Sequence
|
||||
|
||||
import pytz
|
||||
from django.conf import settings
|
||||
from django.db import connection
|
||||
from django.db.backends.utils import CursorWrapper
|
||||
from django.db.models.query import QuerySet
|
||||
from django.template import loader
|
||||
from django.urls import reverse
|
||||
@@ -39,7 +39,7 @@ def make_table(
|
||||
return content
|
||||
|
||||
|
||||
def dictfetchall(cursor: connection.cursor) -> List[Dict[str, Any]]:
|
||||
def dictfetchall(cursor: CursorWrapper) -> List[Dict[str, Any]]:
|
||||
"Returns all rows from a cursor as a dict"
|
||||
desc = cursor.description
|
||||
return [dict(zip((col[0] for col in desc), row)) for row in cursor.fetchall()]
|
||||
|
||||
Reference in New Issue
Block a user