Skip to content

Commit f114b53

Browse files
committed
Fix some as_sql() signatures
1 parent 2f26682 commit f114b53

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/django_mysql/models/lookups.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Any, Callable, Iterable
3+
from typing import Any, Iterable
44

55
from django.db.backends.base.base import BaseDatabaseWrapper
66
from django.db.models import CharField, Lookup, Transform
@@ -20,11 +20,11 @@ class SoundsLike(Lookup):
2020

2121
def as_sql(
2222
self,
23-
qn: Callable[[str], str],
23+
compiler: SQLCompiler,
2424
connection: BaseDatabaseWrapper,
2525
) -> tuple[str, Iterable[Any]]:
26-
lhs, lhs_params = self.process_lhs(qn, connection)
27-
rhs, rhs_params = self.process_rhs(qn, connection)
26+
lhs, lhs_params = self.process_lhs(compiler, connection)
27+
rhs, rhs_params = self.process_rhs(compiler, connection)
2828
params = tuple(lhs_params) + tuple(rhs_params)
2929
return f"{lhs} SOUNDS LIKE {rhs}", params
3030

@@ -62,10 +62,10 @@ def get_prep_lookup(self) -> Any:
6262
return super().get_prep_lookup()
6363

6464
def as_sql(
65-
self, qn: Callable[[str], str], connection: BaseDatabaseWrapper
65+
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper
6666
) -> tuple[str, Iterable[Any]]:
67-
lhs, lhs_params = self.process_lhs(qn, connection)
68-
rhs, rhs_params = self.process_rhs(qn, connection)
67+
lhs, lhs_params = self.process_lhs(compiler, connection)
68+
rhs, rhs_params = self.process_rhs(compiler, connection)
6969
params = tuple(lhs_params) + tuple(rhs_params)
7070
# Put rhs on the left since that's the order FIND_IN_SET uses
7171
return f"FIND_IN_SET({rhs}, {lhs})", params
@@ -82,9 +82,9 @@ class DynColHasKey(Lookup):
8282
lookup_name = "has_key"
8383

8484
def as_sql(
85-
self, qn: Callable[[str], str], connection: BaseDatabaseWrapper
85+
self, compiler: SQLCompiler, connection: BaseDatabaseWrapper
8686
) -> tuple[str, Iterable[Any]]:
87-
lhs, lhs_params = self.process_lhs(qn, connection)
88-
rhs, rhs_params = self.process_rhs(qn, connection)
87+
lhs, lhs_params = self.process_lhs(compiler, connection)
88+
rhs, rhs_params = self.process_rhs(compiler, connection)
8989
params = tuple(lhs_params) + tuple(rhs_params)
9090
return f"COLUMN_EXISTS({lhs}, {rhs})", params

0 commit comments

Comments
 (0)