Skip to content

Commit cad9006

Browse files
committed
dont run both modin and modin[pyarrow] in ci
1 parent 5d267e3 commit cad9006

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

narwhals/_arrow/expr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ def is_first_distinct(self: Self) -> Self:
352352
def is_last_distinct(self: Self) -> Self:
353353
return reuse_series_implementation(self, "is_last_distinct")
354354

355-
def unique(self: Self, *, maintain_order: bool) -> Self:
356-
return reuse_series_implementation(self, "unique", maintain_order=maintain_order)
355+
def unique(self: Self) -> Self:
356+
return reuse_series_implementation(self, "unique", maintain_order=False)
357357

358358
def replace_strict(
359359
self: Self, old: Sequence[Any], new: Sequence[Any], *, return_dtype: DType | None

narwhals/_arrow/series.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,7 @@ def is_sorted(self: Self, *, descending: bool) -> bool:
683683
return maybe_extract_py_scalar(result, return_py_scalar=True) # type: ignore[no-any-return]
684684

685685
def unique(self: Self, *, maintain_order: bool) -> ArrowSeries:
686-
# The param `maintain_order` is only here for compatibility with the Polars API
687-
# and has no effect on the output.
688-
686+
# TODO(marco): `pc.unique` seems to always maintain order, is that guaranteed?
689687
return self._from_native_series(pc.unique(self._native_series))
690688

691689
def replace_strict(

narwhals/_dask/expr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,7 @@ def round(self, decimals: int) -> Self:
447447
returns_scalar=self._returns_scalar,
448448
)
449449

450-
def unique(self, *, maintain_order: bool) -> Self:
451-
# TODO(marco): maintain_order has no effect and will be deprecated
450+
def unique(self) -> Self:
452451
return self._from_call(
453452
lambda _input: _input.unique(),
454453
"unique",

narwhals/_pandas_like/expr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ def abs(self) -> Self:
351351
def cum_sum(self: Self, *, reverse: bool) -> Self:
352352
return reuse_series_implementation(self, "cum_sum", reverse=reverse)
353353

354-
def unique(self, *, maintain_order: bool = False) -> Self:
355-
return reuse_series_implementation(self, "unique", maintain_order=maintain_order)
354+
def unique(self) -> Self:
355+
return reuse_series_implementation(self, "unique", maintain_order=False)
356356

357357
def diff(self) -> Self:
358358
return reuse_series_implementation(self, "diff")

narwhals/_pandas_like/series.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,8 @@ def cum_sum(self: Self, *, reverse: bool) -> Self:
735735
)
736736
return self._from_native_series(result)
737737

738-
def unique(self, *, maintain_order: bool = False) -> PandasLikeSeries:
739-
# The param `maintain_order` is only here for compatibility with the Polars API
740-
# and has no effect on the output.
738+
def unique(self) -> PandasLikeSeries:
739+
# pandas seems to always maintain order - is that guaranteed?
741740
return self._from_native_series(
742741
self._native_series.__class__(
743742
self._native_series.unique(), name=self._native_series.name

narwhals/stable/v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,8 @@ def unique(self, *, maintain_order: bool | None = None) -> Self:
935935
return self.__class__(
936936
lambda plx: self._to_compliant_expr(plx).unique(),
937937
self._is_order_dependent,
938+
changes_length=True,
939+
aggregates=self._aggregates,
938940
)
939941

940942
def sort(self, *, descending: bool = False, nulls_last: bool = False) -> Self:

tests/conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
205205
*iter(LAZY_CONSTRUCTORS.keys()),
206206
]
207207
selected_constructors = [
208-
x for x in selected_constructors if x not in GPU_CONSTRUCTORS
208+
x
209+
for x in selected_constructors
210+
if x not in GPU_CONSTRUCTORS and x not in "modin" # too slow
209211
]
210212
else: # pragma: no cover
211213
selected_constructors = metafunc.config.getoption("constructors").split(",")
@@ -242,7 +244,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None:
242244
if (
243245
any(
244246
x in str(metafunc.module)
245-
for x in ("list", "unpivot", "from_dict", "from_numpy", "tail")
247+
for x in ("list", "unpivot", "from_dict", "from_numpy")
246248
)
247249
and LAZY_CONSTRUCTORS["duckdb"] in constructors
248250
):

0 commit comments

Comments
 (0)