We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
expression: Expression
3.11
4.2
MySQL 8.0
latest
First arg to constructor is currently annotated as expression: Expression:
https://github.com/adamchainz/django-mysql/blob/main/src/django_mysql/models/aggregates.py#L27-L37
Example usage code in docs is:
author = Author.objects.annotate(book_ids=GroupConcat("books__id")).get( name="William Shakespeare" )
"books__id" is a str and not an Expression, giving type errors when using as intended
"books__id"
str
Expression
also F("books_id") would not pass either, as F does not inherit from Expression (they are both instances of Combinable)
F("books_id")
F
Combinable
https://github.com/django/django/blob/4.2/django/db/models/expressions.py#L474
The text was updated successfully, but these errors were encountered:
Correct. It looks like the annotation should probably be just Any, as per the superclass: https://github.com/typeddjango/django-stubs/blob/2cb9c832e97ea5a73d11596696effaab065dff94/django-stubs/db/models/aggregates.pyi#L11 . Do you agree? If so, could you open a PR?
Any
Sorry, something went wrong.
No branches or pull requests
Python Version
3.11
Django Version
4.2
MariaDB/MySQL Version
MySQL 8.0
Package Version
latest
Description
First arg to constructor is currently annotated as
expression: Expression
:https://github.com/adamchainz/django-mysql/blob/main/src/django_mysql/models/aggregates.py#L27-L37
Example usage code in docs is:
"books__id"
is astr
and not anExpression
, giving type errors when using as intendedalso
F("books_id")
would not pass either, asF
does not inherit fromExpression
(they are both instances ofCombinable
)https://github.com/django/django/blob/4.2/django/db/models/expressions.py#L474
The text was updated successfully, but these errors were encountered: