Skip to content

Commit

Permalink
test: unxfail more modin tests (narwhals-dev#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Aug 26, 2024
1 parent 9fdef26 commit 570ca78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 6 additions & 2 deletions narwhals/_pandas_like/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,17 @@ def to_pandas(self) -> Any:

# --- descriptive ---
def is_duplicated(self: Self) -> Self:
return self._from_native_series(self._native_series.duplicated(keep=False))
res = self._native_series.duplicated(keep=False)
res = self._rename(res, self.name)
return self._from_native_series(res)

def is_empty(self: Self) -> bool:
return self._native_series.empty # type: ignore[no-any-return]

def is_unique(self: Self) -> Self:
return self._from_native_series(~self._native_series.duplicated(keep=False))
res = ~self._native_series.duplicated(keep=False)
res = self._rename(res, self.name)
return self._from_native_series(res)

def null_count(self: Self) -> int:
return self._native_series.isna().sum() # type: ignore[no-any-return]
Expand Down
7 changes: 1 addition & 6 deletions tests/expr_and_series/is_duplicated_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import Any

import pytest

import narwhals.stable.v1 as nw
from tests.utils import compare_dicts

Expand All @@ -11,10 +9,7 @@
}


def test_is_duplicated_expr(constructor: Any, request: Any) -> None:
if "modin" in str(constructor):
# TODO(unassigned): why is Modin failing here?
request.applymarker(pytest.mark.xfail)
def test_is_duplicated_expr(constructor: Any) -> None:
df = nw.from_native(constructor(data))
result = df.select(nw.all().is_duplicated())
expected = {
Expand Down
7 changes: 1 addition & 6 deletions tests/expr_and_series/is_unique_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from typing import Any

import pytest

import narwhals.stable.v1 as nw
from tests.utils import compare_dicts

Expand All @@ -11,10 +9,7 @@
}


def test_is_unique_expr(constructor: Any, request: Any) -> None:
if "modin" in str(constructor):
# TODO(unassigned): why is Modin failing here?
request.applymarker(pytest.mark.xfail)
def test_is_unique_expr(constructor: Any) -> None:
df = nw.from_native(constructor(data))
result = df.select(nw.all().is_unique())
expected = {
Expand Down

0 comments on commit 570ca78

Please sign in to comment.