Skip to content

Commit 2bd2b9b

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

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

narwhals/_sql/typing.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,27 @@
1414
SQLLazyFrameT = TypeVar("SQLLazyFrameT", bound="SQLLazyFrameAny")
1515

1616

17-
# it needs to inherit from SQLExpr, but getting errors if passing SQLExprT. I have not sorted out what relation
17+
# it needs to inherit from SQLExpr, but getting errors if passing SQLExprT. I have not sorted out what relation
1818
# (covarinant, contravariant or intravariant it needs to be yet) it needs to have to its parent class
1919
class NativeSQLExpr(SQLExprT):
2020
# not sure how to initialise the class, I want it to have all the methods etc of SQLExprT and add its own operator
21-
# methods in addition to those
21+
# methods in addition to those
2222
def __init__(self, other: [Int | Float]) -> None:
2323
super().__init__(other)
2424

25-
# I've seen lots of examples of the operator dunder methods being used, but I'm struggling with
25+
# I've seen lots of examples of the operator dunder methods being used, but I'm struggling with
2626
# the typing. for sql, there are nice binary examples, but that's not the right method
2727
# e.g.
2828
def __gt__(self, other: Self) -> Self:
2929
return self._with_binary(lambda expr, other: expr.__gt__(other), other)
30-
30+
3131
def __and__(self, other: Self) -> Self:
3232
return self._with_binary(lambda expr, other: expr.__and__(other), other)
33-
33+
3434
# so it should probably look more like something from the polars examples,
35-
# where we just apply the native method:
35+
# where we just apply the native method:
3636
def __gt__(self, other: Any) -> Self:
3737
return self._with_native(self.native.__gt__(extract_native(other)))
3838

3939
def __le__(self, other: Any) -> Self:
4040
return self._with_native(self.native.__le__(extract_native(other)))
41-
42-
43-
44-
45-
46-
47-

0 commit comments

Comments
 (0)