Skip to content

Commit 7639367

Browse files
committed
Fix types for IndexLookup.as_sql()
1 parent 586531a commit 7639367

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/django_mysql/models/fields/lists.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from typing import Any
44
from typing import Callable
5-
from typing import Iterable
65
from typing import cast
76

87
from django.core import checks
@@ -14,6 +13,7 @@
1413
from django.db.models import Model
1514
from django.db.models import TextField
1615
from django.db.models.expressions import BaseExpression
16+
from django.db.models.sql.compiler import SQLCompiler
1717
from django.forms import Field as FormField
1818
from django.utils.translation import gettext_lazy as _
1919

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

232232
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)
233+
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper
234+
) -> tuple[str, list[str | int]]:
235+
lhs, lhs_params = self.process_lhs(compiler, connection)
236+
rhs, rhs_params = self.process_rhs(compiler, connection)
237237
params = tuple(lhs_params) + tuple(rhs_params)
238238
# Put rhs on the left since that's the order FIND_IN_SET uses
239239
return f"(FIND_IN_SET({rhs}, {lhs}) = {self.index})", params

0 commit comments

Comments
 (0)