Skip to content

Commit

Permalink
more cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Feb 23, 2024
1 parent 08393ea commit 7a27623
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions narwhals/pandas_like/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def schema(self) -> dict[str, DType]:
def shape(self) -> tuple[int, int]:
return self._dataframe.shape # type: ignore[no-any-return]

# --- reshaping ---
# --- reshape ---
def with_columns(
self,
*exprs: IntoExpr | Iterable[IntoExpr],
Expand All @@ -112,7 +112,7 @@ def filter(
def rename(self, mapping: dict[str, str]) -> Self:
return self._dispatch_to_lazy("rename", mapping)

# --- transforms ---
# --- transform ---
def sort(
self,
by: str | Iterable[str],
Expand Down Expand Up @@ -165,7 +165,7 @@ def join(
"join", other.lazy(), how=how, left_on=left_on, right_on=right_on
)

# --- partial reductions ---
# --- partial reduction ---
def head(self, n: int) -> Self:
return self._dispatch_to_lazy("head", n)

Expand Down Expand Up @@ -237,7 +237,7 @@ def schema(self) -> dict[str, DType]:
col: translate_dtype(dtype) for col, dtype in self._dataframe.dtypes.items()
}

# --- reshaping ---
# --- reshape ---
def select(
self,
*exprs: IntoExpr | Iterable[IntoExpr],
Expand Down Expand Up @@ -275,7 +275,7 @@ def with_columns(
def rename(self, mapping: dict[str, str]) -> Self:
return self._from_dataframe(self._dataframe.rename(columns=mapping))

# --- transforms ---
# --- transform ---
def sort(
self,
by: str | Iterable[str],
Expand Down Expand Up @@ -340,7 +340,7 @@ def join(
),
)

# --- partial reductions ---
# --- partial reduction ---

def head(self, n: int) -> Self:
return self._from_dataframe(self._dataframe.head(n))
Expand Down
2 changes: 1 addition & 1 deletion narwhals/pandas_like/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def all(self) -> Expr:
implementation=self._implementation,
)

# --- reductions ---
# --- reduction ---
def sum(self, *column_names: str) -> Expr:
return Expr.from_column_names(
*column_names, implementation=self._implementation
Expand Down
18 changes: 9 additions & 9 deletions narwhals/spec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def max(self) -> Expr:
def n_unique(self) -> Expr:
...

# --- transforms ---
# --- transform ---
def is_between(
self, lower_bound: Any, upper_bound: Any, closed: str = "both"
) -> Expr:
Expand All @@ -87,7 +87,7 @@ def is_in(self, other: Any) -> Expr:
def is_null(self) -> Expr:
...

# --- partial reductions ---
# --- partial reduction ---
def drop_nulls(self) -> Expr:
...

Expand Down Expand Up @@ -132,7 +132,7 @@ def col(self, *names: str | Iterable[str]) -> Expr:
def all(self) -> Expr:
...

# --- reductions ---
# --- reduction ---
def sum(self, *columns: str) -> Expr:
...

Expand Down Expand Up @@ -220,7 +220,7 @@ def schema(self) -> dict[str, DType]:
def shape(self) -> tuple[int, int]:
...

# --- reshaping ---
# --- reshape ---
def with_columns(
self, *exprs: IntoExpr | Iterable[IntoExpr], **named_exprs: IntoExpr
) -> Self:
Expand All @@ -237,7 +237,7 @@ def select(
def rename(self, mapping: dict[str, str]) -> Self:
...

# --- transforms ---
# --- transform ---
def sort(
self,
by: str | Iterable[str],
Expand Down Expand Up @@ -273,7 +273,7 @@ def join(
def group_by(self, *keys: str | Iterable[str]) -> GroupBy:
...

# --- partial reductions ---
# --- partial reduction ---
def head(self, n: int) -> Self:
...

Expand All @@ -291,7 +291,7 @@ def columns(self) -> list[str]:
def schema(self) -> dict[str, DType]:
...

# --- reshaping ---
# --- reshape ---
def with_columns(
self, *exprs: IntoExpr | Iterable[IntoExpr], **named_exprs: IntoExpr
) -> Self:
Expand All @@ -305,7 +305,7 @@ def select(
) -> Self:
...

# --- transforms ---
# --- transform ---
def sort(
self,
by: str | Iterable[str],
Expand All @@ -332,7 +332,7 @@ def join(
) -> Self:
...

# --- partial reductions ---
# --- partial reduction ---
def head(self, n: int) -> Self:
...

Expand Down

0 comments on commit 7a27623

Please sign in to comment.