Skip to content

Commit 70cc069

Browse files
committed
fix: Make .drop(strict=...) keyword-only
`nw.DataFrame` already calls with keyword
1 parent 5752913 commit 70cc069

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

narwhals/_arrow/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def join(
453453

454454
join_asof = not_implemented()
455455

456-
def drop(self: Self, columns: Sequence[str], strict: bool) -> Self: # noqa: FBT001
456+
def drop(self: Self, columns: Sequence[str], *, strict: bool) -> Self:
457457
to_drop = parse_columns_to_drop(
458458
compliant_frame=self, columns=columns, strict=strict
459459
)

narwhals/_compliant/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def collect(
6666
self, backend: Implementation | None, **kwargs: Any
6767
) -> CompliantDataFrame[Any]: ...
6868
def collect_schema(self) -> Mapping[str, DType]: ...
69-
def drop(self, columns: Sequence[str], strict: bool) -> Self: ... # noqa: FBT001
69+
def drop(self, columns: Sequence[str], *, strict: bool) -> Self: ...
7070
def drop_nulls(self, subset: Sequence[str] | None) -> Self: ...
7171
def estimated_size(self, unit: SizeUnit) -> int | float: ...
7272
def filter(self, predicate: Any) -> Self: ...

narwhals/_pandas_like/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def rename(self: Self, mapping: Mapping[str, str]) -> Self:
503503
)
504504
)
505505

506-
def drop(self: Self, columns: Sequence[str], strict: bool) -> Self: # noqa: FBT001
506+
def drop(self: Self, columns: Sequence[str], *, strict: bool) -> Self:
507507
to_drop = parse_columns_to_drop(
508508
compliant_frame=self, columns=columns, strict=strict
509509
)

narwhals/_polars/dataframe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def with_row_index(self: Self, name: str) -> Self:
348348
return self._from_native_frame(self._native_frame.with_row_count(name))
349349
return self._from_native_frame(self._native_frame.with_row_index(name))
350350

351-
def drop(self: Self, columns: Sequence[str], strict: bool) -> Self: # noqa: FBT001
351+
def drop(self: Self, columns: Sequence[str], *, strict: bool) -> Self:
352352
to_drop = parse_columns_to_drop(
353353
compliant_frame=self, columns=columns, strict=strict
354354
)

0 commit comments

Comments
 (0)