File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 2828 from narwhals ._sql .namespace import SQLNamespace
2929 from narwhals .typing import NumericLiteral , PythonLiteral , RankMethod , TemporalLiteral
3030
31-
32- class SQLExpr (LazyExpr [SQLLazyFrameT , NativeExprT ], Protocol [SQLLazyFrameT , NativeExprT ]):
33- _call : EvalSeries [SQLLazyFrameT , NativeExprT ]
31+ # am I right in thinking we need to pass NativeSQLExprT here, not NativeExprT? since NativeSQLExprT
32+ # inherits from it, I can use that througout in the code and it will also have its parents functionality.
33+ # though at the moment there are still problems with the class..
34+ class SQLExpr (LazyExpr [SQLLazyFrameT , NativeSQLExprT ], Protocol [SQLLazyFrameT , NativeSQLExprT ]):
35+ _call : EvalSeries [SQLLazyFrameT , NativeSQLExprT ]
3436 _evaluate_output_names : EvalNames [SQLLazyFrameT ]
3537 _alias_output_names : AliasNames | None
3638 _version : Version
3739 _implementation : Implementation
3840 _metadata : ExprMetadata | None
39- _window_function : WindowFunction [SQLLazyFrameT , NativeExprT ] | None
41+ _window_function : WindowFunction [SQLLazyFrameT , NativeSQLExprT ] | None
4042
4143 def __init__ (
4244 self ,
Original file line number Diff line number Diff line change @@ -35,8 +35,11 @@ def __mul__(self, value: Self) -> Self: ...
3535 # TODO: @mp, understand why these are here & if we need one for NativeSQLExprT;
3636 # seem to reflect number of different 'catgories' each of the parent class has
3737 # tbc! since NativeExpr only has Protocol, I don't think we need this for NativeSQLExpr
38+ # NativeSQLExpr isn't accepting Any arguments :) I need to go back to the reading on
39+ # cov-, contra- & invariance
3840 SQLExprAny = SQLExpr [Any , Any ]
3941 SQLLazyFrameAny = SQLLazyFrame [Any , Any , Any ]
42+ NativeSQLExprAny = NativeSQLExpr
4043
4144SQLExprT = TypeVar ("SQLExprT" , bound = "SQLExprAny" )
4245SQLExprT_contra = TypeVar ("SQLExprT_contra" , bound = "SQLExprAny" , contravariant = True )
You can’t perform that action at this time.
0 commit comments