Skip to content

Commit

Permalink
Implement isnull (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
phofl authored Aug 8, 2023
1 parent 65163cd commit a38cbf9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dask_expr/_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ def to_timestamp(self, freq=None, how="start"):
def isna(self):
return new_collection(self.expr.isna())

def isnull(self):
return new_collection(self.expr.isnull())

def round(self, decimals=0):
return new_collection(self.expr.round(decimals))

Expand Down
4 changes: 4 additions & 0 deletions dask_expr/_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,10 @@ def to_timestamp(self, freq=None, how="start"):
def isna(self):
return IsNa(self)

def isnull(self):
# These are the same anyway
return IsNa(self)

def round(self, decimals=0):
return Round(self, decimals=decimals)

Expand Down
2 changes: 2 additions & 0 deletions dask_expr/tests/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ def test_to_timestamp(pdf, how):
lambda df: df.x.replace(to_replace=1, value=1000),
lambda df: df.isna(),
lambda df: df.x.isna(),
lambda df: df.isnull(),
lambda df: df.x.isnull(),
lambda df: df.abs(),
lambda df: df.x.abs(),
lambda df: df.rename(columns={"x": "xx"}),
Expand Down

0 comments on commit a38cbf9

Please sign in to comment.