Skip to content

Commit fc60d02

Browse files
authored
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
1 parent 26e8959 commit fc60d02

File tree

1 file changed

+2
-2
lines changed
  • stubs/google-cloud-ndb/google/cloud/ndb

1 file changed

+2
-2
lines changed

stubs/google-cloud-ndb/google/cloud/ndb/model.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class Model(_NotEqualMixin, metaclass=MetaModel):
320320
max_memcache_items: int | None = ...,
321321
force_writes: bool | None = ...,
322322
_options=...,
323-
) -> tasklets_module.Future: ...
323+
) -> Model | None: ...
324324
@classmethod
325325
def get_by_id_async(
326326
cls: type[Model],
@@ -344,7 +344,7 @@ class Model(_NotEqualMixin, metaclass=MetaModel):
344344
max_memcache_items: int | None = ...,
345345
force_writes: bool | None = ...,
346346
_options=...,
347-
) -> Model | None: ...
347+
) -> tasklets_module.Future: ...
348348
@classmethod
349349
def get_or_insert(
350350
cls: type[Model],

0 commit comments

Comments
 (0)