Skip to content

Commit 85e710e

Browse files
committed
Fold None comparison coverage into relational expr test
1 parent 4000b95 commit 85e710e

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

python/tests/test_expr.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ def test_relational_expr(test_ctx):
153153

154154
batch = pa.RecordBatch.from_arrays(
155155
[
156-
pa.array([1, 2, 3]),
157-
pa.array(["alpha", "beta", "gamma"], type=pa.string_view()),
156+
pa.array([1, 2, 3, None]),
157+
pa.array(["alpha", "beta", "gamma", None], type=pa.string_view()),
158158
],
159159
names=["a", "b"],
160160
)
@@ -171,24 +171,10 @@ def test_relational_expr(test_ctx):
171171
assert df.filter(col("b") != "beta").count() == 2
172172

173173
assert df.filter(col("a") == "beta").count() == 0
174-
175-
176-
def test_relational_expr_none_uses_null_predicates():
177-
ctx = SessionContext()
178-
179-
batch = pa.RecordBatch.from_arrays(
180-
[
181-
pa.array([1, 2, None]),
182-
pa.array(["alpha", None, "gamma"], type=pa.string_view()),
183-
],
184-
names=["a", "b"],
185-
)
186-
df = ctx.create_dataframe([[batch]], name="batch_with_nulls")
187-
188174
assert df.filter(col("a") == None).count() == 1 # noqa: E711
189-
assert df.filter(col("a") != None).count() == 2 # noqa: E711
175+
assert df.filter(col("a") != None).count() == 3 # noqa: E711
190176
assert df.filter(col("b") == None).count() == 1 # noqa: E711
191-
assert df.filter(col("b") != None).count() == 2 # noqa: E711
177+
assert df.filter(col("b") != None).count() == 3 # noqa: E711
192178

193179

194180
def test_expr_to_variant():

0 commit comments

Comments
 (0)