Skip to content

Commit

Permalink
to lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed Aug 26, 2024
1 parent f60793e commit 28713e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions narwhals/stable/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,22 +1339,22 @@ def mean_horizontal(*exprs: IntoExpr | Iterable[IntoExpr]) -> Expr:

@overload
def concat(
items: Iterable[NwDataFrame[Any]],
items: Iterable[DataFrame[Any]],
*,
how: Literal["horizontal", "vertical"] = "vertical",
) -> DataFrame[Any]: ...


@overload
def concat(
items: Iterable[NwLazyFrame[Any]],
items: Iterable[LazyFrame[Any]],
*,
how: Literal["horizontal", "vertical"] = "vertical",
) -> LazyFrame[Any]: ...


def concat(
items: Iterable[NwDataFrame[Any] | NwLazyFrame[Any]],
items: Iterable[DataFrame[Any] | LazyFrame[Any]],
*,
how: Literal["horizontal", "vertical"] = "vertical",
) -> DataFrame[Any] | LazyFrame[Any]:
Expand Down
6 changes: 3 additions & 3 deletions tests/frame/concat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ def test_concat_horizontal(constructor: Any, request: Any) -> None:
if "dask" in str(constructor):
request.applymarker(pytest.mark.xfail)
data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8, 9]}
df_left = nw.from_native(constructor(data))
df_left = nw.from_native(constructor(data)).lazy()

data_right = {"c": [6, 12, -1], "d": [0, -4, 2]}
df_right = nw.from_native(constructor(data_right))
df_right = nw.from_native(constructor(data_right)).lazy()

result = nw.concat([df_left, df_right], how="horizontal")
expected = {
Expand All @@ -34,7 +34,7 @@ def test_concat_vertical(constructor: Any, request: Any) -> None:
request.applymarker(pytest.mark.xfail)
data = {"a": [1, 3, 2], "b": [4, 4, 6], "z": [7.0, 8, 9]}
df_left = (
nw.from_native(constructor(data)).rename({"a": "c", "b": "d"}).drop("z").lazy()
nw.from_native(constructor(data)).lazy().rename({"a": "c", "b": "d"}).drop("z")
)

data_right = {"c": [6, 12, -1], "d": [0, -4, 2]}
Expand Down

0 comments on commit 28713e7

Please sign in to comment.