Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aiterator #1449

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Fix aiterator #1449

merged 1 commit into from
Apr 20, 2023

Conversation

kjagiello
Copy link
Contributor

This changeset fixes the following:

  1. aiterator does not exist on RawQuerySet in Django, so the corresponding typedef is getting removed here
  2. aiterator typedef was missing on _QuerySet even though it is supported by Django
  3. aiterator typedef was incorrectly typed on BaseManager

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -37,7 +37,7 @@ class BaseManager(Generic[_T]):
# NOTE: The following methods are in common with QuerySet, but note that the use of QuerySet as a return type
# rather than a self-type (_QS), since Manager's QuerySet-like methods return QuerySets and not Managers.
def iterator(self, chunk_size: int = ...) -> Iterator[_T]: ...
async def aiterator(self, chunk_size: int = ...) -> Iterator[_T]: ...
def aiterator(self, chunk_size: int = ...) -> AsyncIterator[_T]: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird that the async keyword has to be removed as well. But according to this SO post https://stackoverflow.com/a/68911014/177663 that is correct.

@sobolevn sobolevn closed this Apr 20, 2023
@sobolevn sobolevn reopened this Apr 20, 2023
@sobolevn sobolevn merged commit e06689e into typeddjango:master Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants