Skip to content

Commit 6022cba

Browse files
committed
Add isnan
1 parent b4d383b commit 6022cba

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

datafusion/tests/test_functions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def test_math_functions():
131131
f.sinh(col_v),
132132
f.tanh(col_v),
133133
f.factorial(literal(6)),
134+
f.isnan(col_nav),
134135
)
135136
batches = df.collect()
136137
assert len(batches) == 1
@@ -185,6 +186,7 @@ def test_math_functions():
185186
np.testing.assert_array_almost_equal(result.column(32), np.sinh(values))
186187
np.testing.assert_array_almost_equal(result.column(33), np.tanh(values))
187188
np.testing.assert_array_almost_equal(result.column(34), math.factorial(6))
189+
np.testing.assert_array_almost_equal(result.column(35), np.isnan(na_values))
188190

189191

190192
def test_string_functions(df):

src/functions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ scalar_function!(factorial, Factorial);
230230
scalar_function!(floor, Floor);
231231
scalar_function!(gcd, Gcd);
232232
scalar_function!(initcap, InitCap, "Converts the first letter of each word to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters.");
233+
scalar_function!(isnan, IsNaN, "Returns true if a given number is +NaN or -NaN otherwise returns false.");
233234
scalar_function!(lcm, Lcm);
234235
scalar_function!(left, Left, "Returns first n characters in the string, or when n is negative, returns all but last |n| characters.");
235236
scalar_function!(ln, Ln);

0 commit comments

Comments
 (0)