Fix mistyped get_by_id class methods (#7120)

The types for these class methods were mixed up. The async method
returned an optional `Model`, while the synchronous method returned a
`Future`. It's the other way around.

Fixes #7103
This commit is contained in:
Roman Joost
2022-02-03 09:59:02 +10:00
committed by GitHub
parent 26e8959279
commit fc60d02c3e

View File

@@ -320,7 +320,7 @@ class Model(_NotEqualMixin, metaclass=MetaModel):
max_memcache_items: int | None = ...,
force_writes: bool | None = ...,
_options=...,
) -> tasklets_module.Future: ...
) -> Model | None: ...
@classmethod
def get_by_id_async(
cls: type[Model],
@@ -344,7 +344,7 @@ class Model(_NotEqualMixin, metaclass=MetaModel):
max_memcache_items: int | None = ...,
force_writes: bool | None = ...,
_options=...,
) -> Model | None: ...
) -> tasklets_module.Future: ...
@classmethod
def get_or_insert(
cls: type[Model],