mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 23:41:55 +08:00
Update MigrationExecutor stubs to use Sequence (#749)
There is no need for a specific List type here, using a higher type works fine and allows more working code to pass type-checking.
This commit is contained in:
committed by
GitHub
parent
48aaf3d2ac
commit
b5c20100ff
@@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Callable, List, Optional, Set, Tuple, Union
|
from typing import Any, Callable, List, Optional, Sequence, Set, Tuple, Union
|
||||||
|
|
||||||
from django.db.backends.base.base import BaseDatabaseWrapper
|
from django.db.backends.base.base import BaseDatabaseWrapper
|
||||||
from django.db.migrations.migration import Migration
|
from django.db.migrations.migration import Migration
|
||||||
@@ -18,17 +18,17 @@ class MigrationExecutor:
|
|||||||
progress_callback: Optional[Callable] = ...,
|
progress_callback: Optional[Callable] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
def migration_plan(
|
def migration_plan(
|
||||||
self, targets: Union[List[Tuple[str, Optional[str]]], Set[Tuple[str, str]]], clean_start: bool = ...
|
self, targets: Union[Sequence[Tuple[str, Optional[str]]], Set[Tuple[str, str]]], clean_start: bool = ...
|
||||||
) -> List[Tuple[Migration, bool]]: ...
|
) -> List[Tuple[Migration, bool]]: ...
|
||||||
def migrate(
|
def migrate(
|
||||||
self,
|
self,
|
||||||
targets: Optional[List[Tuple[str, Optional[str]]]],
|
targets: Optional[Sequence[Tuple[str, Optional[str]]]],
|
||||||
plan: Optional[List[Tuple[Migration, bool]]] = ...,
|
plan: Optional[Sequence[Tuple[Migration, bool]]] = ...,
|
||||||
state: Optional[ProjectState] = ...,
|
state: Optional[ProjectState] = ...,
|
||||||
fake: bool = ...,
|
fake: bool = ...,
|
||||||
fake_initial: bool = ...,
|
fake_initial: bool = ...,
|
||||||
) -> ProjectState: ...
|
) -> ProjectState: ...
|
||||||
def collect_sql(self, plan: List[Tuple[Migration, bool]]) -> List[str]: ...
|
def collect_sql(self, plan: Sequence[Tuple[Migration, bool]]) -> List[str]: ...
|
||||||
def apply_migration(
|
def apply_migration(
|
||||||
self, state: ProjectState, migration: Migration, fake: bool = ..., fake_initial: bool = ...
|
self, state: ProjectState, migration: Migration, fake: bool = ..., fake_initial: bool = ...
|
||||||
) -> ProjectState: ...
|
) -> ProjectState: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user