Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/safeds/data/tabular/containers/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ def remove_rows(
mask = predicate(_LazyVectorizedRow(self))

return Table._from_polars_lazy_frame(
self._lazy_frame.filter(~mask._polars_expression),
self._lazy_frame.remove(mask._polars_expression),
)

def remove_rows_by_column(
Expand Down Expand Up @@ -1592,7 +1592,7 @@ def remove_rows_by_column(
mask = predicate(_LazyCell(pl.col(name)))

return Table._from_polars_lazy_frame(
self._lazy_frame.filter(~mask._polars_expression),
self._lazy_frame.remove(mask._polars_expression),
)

def remove_rows_with_missing_values(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@
lambda row: row["col1"] <= 2,
Table({"col1": [1, 2]}),
),
(
lambda: Table({"col1": [None]}),
lambda row: row["col1"] <= 2,
Table({"col1": []}),
),
],
ids=[
"empty",
"no rows",
"no matches",
"some matches",
"only matches",
"None",
],
)
class TestHappyPath:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@
lambda cell: cell <= 2,
Table({"col1": [1, 2], "col2": [-1, -2]}),
),
(
lambda: Table({"col1": [None], "col2": [None]}),
"col1",
lambda cell: cell <= 2,
Table({"col1": [], "col2": []}),
),
],
ids=[
"no rows",
"no matches",
"some matches",
"only matches",
"None",
],
)
class TestHappyPath:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@
lambda row: row["col1"] <= 2,
Table({"col1": []}),
),
(
lambda: Table({"col1": [None]}),
lambda row: row["col1"] <= 2,
Table({"col1": [None]}),
),
],
ids=[
"empty",
"no rows",
"no matches",
"some matches",
"only matches",
"None",
],
)
class TestHappyPath:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@
lambda cell: cell <= 2,
Table({"col1": [], "col2": []}),
),
(
lambda: Table({"col1": [None], "col2": [None]}),
"col1",
lambda cell: cell <= 2,
Table({"col1": [None], "col2": [None]}),
),
],
ids=[
"no rows",
"no matches",
"some matches",
"only matches",
"None",
],
)
class TestHappyPath:
Expand Down