1
1
from __future__ import annotations
2
2
3
+ import sys
3
4
from functools import partial
4
5
from typing import TYPE_CHECKING
6
+ from typing import Any
5
7
from typing import Iterator
6
8
7
9
from narwhals ._pandas_like .dataframe import PandasLikeDataFrame
@@ -47,7 +49,7 @@ def _selector(
47
49
function_name = "selector" ,
48
50
evaluate_output_names = evaluate_output_names ,
49
51
alias_output_names = None ,
50
- implementation = self ._implementation ,
52
+ implementation = self ._implementation , # AttributeError: 'PandasSelector' object has no attribute '_implementation'
51
53
backend_version = self ._backend_version ,
52
54
version = self ._version ,
53
55
)
@@ -58,17 +60,24 @@ def __init__(self: Self, context: _FullContext, /) -> None:
58
60
self ._version = context ._version
59
61
60
62
63
+ # BUG: `3.8` Protocol?
64
+ # https://github.com/narwhals-dev/narwhals/pull/2064#discussion_r1965980715
61
65
class PandasSelector ( # type: ignore[misc]
62
66
CompliantSelector ["PandasLikeDataFrame" , "PandasLikeSeries" ], PandasLikeExpr
63
67
):
68
+ if sys .version_info < (3 , 9 ):
69
+
70
+ def __init__ (self , * args : Any , ** kwds : Any ) -> None :
71
+ super (PandasLikeExpr ).__init__ (* args , ** kwds )
72
+
64
73
def _to_expr (self : Self ) -> PandasLikeExpr :
65
74
return PandasLikeExpr (
66
- self ._call ,
75
+ self ._call , # AttributeError: 'PandasSelector' object has no attribute '_call'
67
76
depth = self ._depth ,
68
77
function_name = self ._function_name ,
69
- evaluate_output_names = self ._evaluate_output_names ,
78
+ evaluate_output_names = self ._evaluate_output_names , # AttributeError: 'PandasSelector' object has no attribute '_evaluate_output_names'
70
79
alias_output_names = self ._alias_output_names ,
71
- implementation = self ._implementation ,
80
+ implementation = self ._implementation , # AttributeError: 'PandasSelector' object has no attribute '_implementation'
72
81
backend_version = self ._backend_version ,
73
82
version = self ._version ,
74
83
)
0 commit comments