zeel2104 commented on code in PR #1489:
URL: 
https://github.com/apache/datafusion-python/pull/1489#discussion_r3070331597


##########
python/tests/test_expr.py:
##########
@@ -173,6 +173,24 @@ def test_relational_expr(test_ctx):
     assert df.filter(col("a") == "beta").count() == 0
 
 
+def test_relational_expr_none_uses_null_predicates():
+    ctx = SessionContext()
+
+    batch = pa.RecordBatch.from_arrays(
+        [
+            pa.array([1, 2, None]),
+            pa.array(["alpha", None, "gamma"], type=pa.string_view()),
+        ],
+        names=["a", "b"],
+    )
+    df = ctx.create_dataframe([[batch]], name="batch_with_nulls")
+
+    assert df.filter(col("a") == None).count() == 1  # noqa: E711
+    assert df.filter(col("a") != None).count() == 2  # noqa: E711
+    assert df.filter(col("b") == None).count() == 1  # noqa: E711
+    assert df.filter(col("b") != None).count() == 2  # noqa: E711

Review Comment:
   Updated the tests to fold the None comparison coverage into 
`test_relational_expr` and pushed the change. Thanks for the suggestion.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to