Skip to content

Commit 8628c09

Browse files
committed
Fix types for IndexLookup.as_sql()
1 parent 33bff0c commit 8628c09

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/django_mysql/models/fields/lists.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from django.db.models import Model
1515
from django.db.models import TextField
1616
from django.db.models.expressions import BaseExpression
17+
from django.db.models.sql.compiler import SQLCompiler
1718
from django.forms import Field as FormField
1819
from django.utils.translation import gettext_lazy as _
1920

@@ -230,10 +231,10 @@ def __init__(self, index: int, *args: Any, **kwargs: Any) -> None:
230231
self.index = index
231232

232233
def as_sql(
233-
self, qn: Callable[[str], str], connection: BaseDatabaseWrapper
234-
) -> tuple[str, Iterable[Any]]:
235-
lhs, lhs_params = self.process_lhs(qn, connection)
236-
rhs, rhs_params = self.process_rhs(qn, connection)
234+
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper
235+
) -> tuple[str, list[str | int]]:
236+
lhs, lhs_params = self.process_lhs(compiler, connection)
237+
rhs, rhs_params = self.process_rhs(compiler, connection)
237238
params = tuple(lhs_params) + tuple(rhs_params)
238239
# Put rhs on the left since that's the order FIND_IN_SET uses
239240
return f"(FIND_IN_SET({rhs}, {lhs}) = {self.index})", params

0 commit comments

Comments
 (0)