mirror of https://github.com/zulip/zulip.git
mypy: Add types-psycopg2.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
5c90522e69
commit
09564e95ac
|
@ -356,7 +356,7 @@ def do_pull_by_sql_query(
|
|||
group_by: Optional[Tuple[Type[models.Model], str]],
|
||||
) -> int:
|
||||
if group_by is None:
|
||||
subgroup = SQL("NULL")
|
||||
subgroup: Composable = SQL("NULL")
|
||||
group_by_clause = SQL("")
|
||||
else:
|
||||
subgroup = Identifier(group_by[0]._meta.db_table, group_by[1])
|
||||
|
|
|
@ -33,6 +33,7 @@ import os
|
|||
import select
|
||||
import sys
|
||||
import time
|
||||
from typing import Optional
|
||||
|
||||
import psycopg2
|
||||
import psycopg2.extensions
|
||||
|
@ -136,6 +137,7 @@ except ImportError:
|
|||
pg_args["host"] = "localhost"
|
||||
pg_args["dbname"] = get_config(config_file, "postgresql", "database_name", "zulip")
|
||||
|
||||
conn: Optional[psycopg2.extensions.connection]
|
||||
|
||||
if options.nagios_check:
|
||||
conn = psycopg2.connect(**pg_args)
|
||||
|
|
|
@ -80,7 +80,6 @@ module = [
|
|||
"openapi_core.*",
|
||||
"openapi_schema_validator.*",
|
||||
"premailer.*",
|
||||
"psycopg2.*",
|
||||
"pyinotify.*",
|
||||
"pyoembed.*",
|
||||
"pyuca.*",
|
||||
|
|
|
@ -1696,6 +1696,10 @@ types-polib==0.1.3 \
|
|||
--hash=sha256:54fb4d5a9edc2b2f7e3cd7ebbf8631dbcecdeb69e9e31597e81c2b5b3bd3613b \
|
||||
--hash=sha256:bd79bc1780e5d7fb6fd0dce59bb8d118ca81f8b2f14d5d05e21d2716e2e1937b
|
||||
# via -r requirements/mypy.in
|
||||
types-psycopg2==2.9.0 \
|
||||
--hash=sha256:6e15cdbae8944271ab5fe413a06b248b714666ba0af4162b62b35da6c7a74e8f \
|
||||
--hash=sha256:c1cd002bb62c044a02a88c48a06b62242d4bd8732d8dd8bf064b29fdaf7771e5
|
||||
# via -r requirements/mypy.in
|
||||
types-pygments==2.9.0 \
|
||||
--hash=sha256:04dd3054e579d739e61c48757962969285ebdd09aca1bdac7c6d210455fb8f98 \
|
||||
--hash=sha256:4dc3c9b1e96bce89b30b32503d9976b2a66dbcf0d285aabc59ffd7302dbf199f
|
||||
|
|
|
@ -19,6 +19,7 @@ types-oauthlib
|
|||
types-orjson
|
||||
types-polib
|
||||
types-Pillow
|
||||
types-psycopg2
|
||||
types-Pygments
|
||||
types-python-dateutil
|
||||
types-pytz
|
||||
|
|
|
@ -137,6 +137,10 @@ types-polib==0.1.3 \
|
|||
--hash=sha256:54fb4d5a9edc2b2f7e3cd7ebbf8631dbcecdeb69e9e31597e81c2b5b3bd3613b \
|
||||
--hash=sha256:bd79bc1780e5d7fb6fd0dce59bb8d118ca81f8b2f14d5d05e21d2716e2e1937b
|
||||
# via -r requirements/mypy.in
|
||||
types-psycopg2==2.9.0 \
|
||||
--hash=sha256:6e15cdbae8944271ab5fe413a06b248b714666ba0af4162b62b35da6c7a74e8f \
|
||||
--hash=sha256:c1cd002bb62c044a02a88c48a06b62242d4bd8732d8dd8bf064b29fdaf7771e5
|
||||
# via -r requirements/mypy.in
|
||||
types-pygments==2.9.0 \
|
||||
--hash=sha256:04dd3054e579d739e61c48757962969285ebdd09aca1bdac7c6d210455fb8f98 \
|
||||
--hash=sha256:4dc3c9b1e96bce89b30b32503d9976b2a66dbcf0d285aabc59ffd7302dbf199f
|
||||
|
|
|
@ -48,4 +48,4 @@ API_FEATURE_LEVEL = 92
|
|||
# historical commits sharing the same major version, in which case a
|
||||
# minor version bump suffices.
|
||||
|
||||
PROVISION_VERSION = "153.11"
|
||||
PROVISION_VERSION = "153.12"
|
||||
|
|
|
@ -93,7 +93,7 @@ models_with_message_key: List[Dict[str, Any]] = [
|
|||
@transaction.atomic(savepoint=False)
|
||||
def move_rows(
|
||||
base_model: Model,
|
||||
raw_query: Composable,
|
||||
raw_query: SQL,
|
||||
*,
|
||||
src_db_table: Optional[str] = None,
|
||||
returning_id: bool = False,
|
||||
|
@ -122,7 +122,7 @@ def move_rows(
|
|||
|
||||
|
||||
def run_archiving_in_chunks(
|
||||
query: Composable,
|
||||
query: SQL,
|
||||
type: int,
|
||||
realm: Optional[Realm] = None,
|
||||
chunk_size: int = MESSAGE_BATCH_SIZE,
|
||||
|
|
|
@ -149,7 +149,7 @@ def queries_captured(
|
|||
|
||||
def wrapper_execute(
|
||||
self: TimeTrackingCursor,
|
||||
action: Callable[[str, ParamsT], None],
|
||||
action: Callable[[Query, ParamsT], None],
|
||||
sql: Query,
|
||||
params: ParamsT,
|
||||
) -> None:
|
||||
|
|
Loading…
Reference in New Issue