blob: ea1c6bac84f233874fcc433fed76be54a1ebb0ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
from __future__ import annotations
from typing import TYPE_CHECKING
from narwhals._compliant import CompliantSelector, LazySelectorNamespace
from narwhals._duckdb.expr import DuckDBExpr
if TYPE_CHECKING:
from duckdb import Expression # noqa: F401
from narwhals._duckdb.dataframe import DuckDBLazyFrame # noqa: F401
class DuckDBSelectorNamespace(LazySelectorNamespace["DuckDBLazyFrame", "Expression"]):
@property
def _selector(self) -> type[DuckDBSelector]:
return DuckDBSelector
class DuckDBSelector( # type: ignore[misc]
CompliantSelector["DuckDBLazyFrame", "Expression"], DuckDBExpr
):
def _to_expr(self) -> DuckDBExpr:
return DuckDBExpr(
self._call,
self._window_function,
evaluate_output_names=self._evaluate_output_names,
alias_output_names=self._alias_output_names,
backend_version=self._backend_version,
version=self._version,
)
|