Skip to content

Commit f540cd8

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 3a97dcb commit f540cd8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

narwhals/_sql/expr.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
combine_alias_output_names,
1616
combine_evaluate_output_names,
1717
)
18-
from narwhals._sql.typing import SQLLazyFrameT, NativeSQLExprT
18+
from narwhals._sql.typing import NativeSQLExprT, SQLLazyFrameT
1919
from narwhals._utils import Implementation, Version, not_implemented
2020

2121
if TYPE_CHECKING:
@@ -496,7 +496,8 @@ def round(self, decimals: int) -> Self:
496496
return self._with_elementwise(
497497
lambda expr: self._function("round", expr, self._lit(decimals))
498498
)
499-
# WIP: trying new NativeSQLExprT
499+
500+
# WIP: trying new NativeSQLExprT
500501
def sqrt(self) -> Self:
501502
def _sqrt(expr: NativeSQLExprT) -> NativeSQLExprT:
502503
return self._when(

narwhals/_sql/typing.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
from narwhals._compliant.expr import NativeExpr
66

7+
78
class NativeSQLExpr(NativeExpr):
8-
# both Self because we're comparing an expression with an expression?
9+
# both Self because we're comparing an expression with an expression?
910
def __gt__(self, value: Self) -> Self: ...
1011

1112
def __lt__(self, value: Self) -> Self: ...
@@ -26,11 +27,12 @@ def __truediv__(self, value: Self) -> Self: ...
2627

2728
def __mul__(self, value: Self) -> Self: ...
2829

30+
2931
if TYPE_CHECKING:
32+
from typing_extensions import Self
33+
3034
from narwhals._sql.dataframe import SQLLazyFrame
3135
from narwhals._sql.expr import SQLExpr
32-
from narwhals.dtypes import Boolean
33-
from typing_extensions import Self
3436

3537
# TODO: @mp, understand why these are here & if we need one for NativeSQLExprT;
3638
# seem to reflect number of different 'catgories' each of the parent class has
@@ -42,5 +44,4 @@ def __mul__(self, value: Self) -> Self: ...
4244
SQLExprT_contra = TypeVar("SQLExprT_contra", bound="SQLExprAny", contravariant=True)
4345
SQLLazyFrameT = TypeVar("SQLLazyFrameT", bound="SQLLazyFrameAny")
4446
# TODO: @mp, should this be contravariant as to do with function arguments? think through!
45-
NativeSQLExprT = TypeVar("NativeSQLExprT", bound="NativeSQLExpr")
46-
47+
NativeSQLExprT = TypeVar("NativeSQLExprT", bound="NativeSQLExpr")

0 commit comments

Comments
 (0)