Skip to content

Commit

Permalink
updates based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
samukweku committed Apr 20, 2023
1 parent 470a53e commit 85909ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
4 changes: 3 additions & 1 deletion docs/api/math/isna.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
Input columns.

return: FExpr
f-expression that returns `0` for valid elements and `1` otherwise. All the resulting columns will have `bool8` stypes and as many rows/columns as there are in `cols`.
f-expression that returns `0` for valid elements and `1` otherwise.
All the resulting columns will have `bool8` stypes
and as many rows/columns as there are in `cols`.

Examples
--------
Expand Down
14 changes: 4 additions & 10 deletions src/core/expr/fbinary/fexpr__eq__.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,9 @@ Column FExpr__eq__::evaluate1(Column&& lcol, Column&& rcol) const {
if (type1.is_void()) {
std::swap(lcol, rcol);
}
switch (type0.stype()) {
case SType::VOID:
return Const_ColumnImpl::make_bool_column(lcol.nrows(), true);
default:
return Column(new Isna_ColumnImpl(std::move(lcol)));
}
if (type0.stype() == SType::VOID) {
return Const_ColumnImpl::make_bool_column(lcol.nrows(), true);
} else return Column(new Isna_ColumnImpl(std::move(lcol)));
} else {
switch (type0.stype()) {
case SType::BOOL:
Expand All @@ -93,9 +90,6 @@ Column FExpr__eq__::evaluate1(Column&& lcol, Column&& rcol) const {
"types `" << type1 << "` and `" << type2 << "`";
}

}} // namespace dt::expr





}} // namespace dt::expr
3 changes: 2 additions & 1 deletion tests/test-f.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,4 +502,5 @@ def test_codes():
def test_isna():
assert str(dt.math.isna(f.A)) == str(f.A.math_isna())
DT = dt.Frame(A = [None, 9, 8, 2, 3, None, None, 3, 0, 5, 5, 8, None])
assert_equals (DT[:, dt.math.isna(f.A)], DT[:, f.A.math_isna()])
assert_equals (DT[:, dt.math.isna(f.A)], DT[:, f.A.math_isna()])

0 comments on commit 85909ef

Please sign in to comment.