Skip to content

Commit 7cd9ca7

Browse files
committed
chore: start aligning PolarsSelectorNamespace
Towards fixing this error, but without subclassing ```py narwhals/utils.py:363: error: Incompatible return value type (got "PolarsNamespace", expected "CompliantNamespace[Any, Any]") [return-value] return PolarsNamespace(backend_version=backend_version, version=version) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ narwhals/utils.py:363: note: Following member(s) of "PolarsNamespace" have conflicts: narwhals/utils.py:363: note: selectors: expected "CompliantSelectorNamespace[Any, Any]", got "PolarsSelectors" ```
1 parent 39382c5 commit 7cd9ca7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

narwhals/_polars/namespace.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,15 @@ def concat_str(
205205
)
206206

207207
@property
208-
def selectors(self: Self) -> PolarsSelectors:
209-
return PolarsSelectors(self._version, backend_version=self._backend_version)
208+
def selectors(self: Self) -> PolarsSelectorNamespace:
209+
return PolarsSelectorNamespace(self)
210210

211211

212-
class PolarsSelectors:
213-
def __init__(self: Self, version: Version, backend_version: tuple[int, ...]) -> None:
214-
self._version = version
215-
self._backend_version = backend_version
212+
class PolarsSelectorNamespace:
213+
def __init__(self: Self, context: _FullContext, /) -> None:
214+
self._implementation = context._implementation
215+
self._backend_version = context._backend_version
216+
self._version = context._version
216217

217218
def by_dtype(self: Self, dtypes: Iterable[DType]) -> PolarsExpr:
218219
native_dtypes = [

0 commit comments

Comments
 (0)