Skip to content

Commit a4edcb7

Browse files
committed
fix(DRAFT): try giving a super(...) hints for 3.8
If this works, the errors in CI should only be for `ArrowSelector` #2064 (comment)
1 parent 7201454 commit a4edcb7

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

narwhals/_pandas_like/selectors.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from __future__ import annotations
22

3+
import sys
34
from functools import partial
45
from typing import TYPE_CHECKING
6+
from typing import Any
57
from typing import Iterator
68

79
from narwhals._pandas_like.dataframe import PandasLikeDataFrame
@@ -47,7 +49,7 @@ def _selector(
4749
function_name="selector",
4850
evaluate_output_names=evaluate_output_names,
4951
alias_output_names=None,
50-
implementation=self._implementation,
52+
implementation=self._implementation, # AttributeError: 'PandasSelector' object has no attribute '_implementation'
5153
backend_version=self._backend_version,
5254
version=self._version,
5355
)
@@ -58,17 +60,24 @@ def __init__(self: Self, context: _FullContext, /) -> None:
5860
self._version = context._version
5961

6062

63+
# BUG: `3.8` Protocol?
64+
# https://github.com/narwhals-dev/narwhals/pull/2064#discussion_r1965980715
6165
class PandasSelector( # type: ignore[misc]
6266
CompliantSelector["PandasLikeDataFrame", "PandasLikeSeries"], PandasLikeExpr
6367
):
68+
if sys.version_info < (3, 9):
69+
70+
def __init__(self, *args: Any, **kwds: Any) -> None:
71+
super(PandasLikeExpr).__init__(*args, **kwds)
72+
6473
def _to_expr(self: Self) -> PandasLikeExpr:
6574
return PandasLikeExpr(
66-
self._call,
75+
self._call, # AttributeError: 'PandasSelector' object has no attribute '_call'
6776
depth=self._depth,
6877
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'
7079
alias_output_names=self._alias_output_names,
71-
implementation=self._implementation,
80+
implementation=self._implementation, # AttributeError: 'PandasSelector' object has no attribute '_implementation'
7281
backend_version=self._backend_version,
7382
version=self._version,
7483
)

0 commit comments

Comments
 (0)