Skip to content

Commit 8cd648b

Browse files
committed
wip typing
1 parent 6b1cde0 commit 8cd648b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

narwhals/spec/__init__.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,23 @@ def to_pandas(self) -> Any:
162162
class DataFrame(Protocol):
163163
def with_columns(
164164
self, *exprs: IntoExpr | Iterable[IntoExpr], **named_exprs: IntoExpr
165-
) -> DataFrame:
165+
) -> Self:
166166
...
167167

168-
def filter(self, *predicates: IntoExpr | Iterable[IntoExpr]) -> DataFrame:
168+
def filter(self, *predicates: IntoExpr | Iterable[IntoExpr]) -> Self:
169169
...
170170

171171
def select(
172172
self, *exprs: IntoExpr | Iterable[IntoExpr], **named_exprs: IntoExpr
173-
) -> DataFrame:
173+
) -> Self:
174174
...
175175

176176
def sort(
177177
self,
178178
by: str | Iterable[str],
179179
*more_by: str,
180180
descending: bool | Iterable[bool] = False,
181-
) -> DataFrame:
181+
) -> Self:
182182
...
183183

184184
def group_by(self, *keys: str | Iterable[str]) -> GroupBy:
@@ -194,24 +194,24 @@ def join(
194194
how: Literal["inner"] = "inner",
195195
left_on: str | list[str],
196196
right_on: str | list[str],
197-
) -> DataFrame:
197+
) -> Self:
198198
...
199199

200200
@property
201201
def columns(self) -> list[str]:
202202
...
203203

204-
def head(self, n: int) -> DataFrame:
204+
def head(self, n: int) -> Self:
205205
...
206206

207-
def unique(self, subset: list[str]) -> DataFrame:
207+
def unique(self, subset: list[str]) -> Self:
208208
...
209209

210210
@property
211211
def shape(self) -> tuple[int, int]:
212212
...
213213

214-
def rename(self, mapping: dict[str, str]) -> DataFrame:
214+
def rename(self, mapping: dict[str, str]) -> Self:
215215
...
216216

217217
def to_numpy(self) -> Any:

0 commit comments

Comments
 (0)