You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/20 23:38:22 UTC

[GitHub] [spark] dgd-contributor commented on a change in pull request #34040: [SPARK-36785][PYTHON] Fix DataFrame.isin when DataFrame has NaN value

dgd-contributor commented on a change in pull request #34040:
URL: https://github.com/apache/spark/pull/34040#discussion_r712591427



##########
File path: python/pyspark/pandas/tests/test_dataframe.py
##########
@@ -1954,6 +1954,41 @@ def test_isin(self):
         with self.assertRaisesRegex(TypeError, msg):
             psdf.isin(1)
 
+        pdf = pd.DataFrame(
+            {
+                "a": [4, 2, 3, 4, 8, 6],
+                "b": [1, None, 9, 4, None, 4],
+                "c": [None, 5, None, 3, 2, 1],
+            },
+        )
+        psdf = ps.from_pandas(pdf)
+
+        if LooseVersion(pd.__version__) >= LooseVersion("1.2"):
+            self.assert_eq(psdf.isin([4, 3, 1, 1, None]), pdf.isin([4, 3, 1, 1, None]))
+        else:
+            expected = pd.DataFrame(
+                {
+                    "a": [True, False, True, True, False, False],
+                    "b": [True, True, False, True, True, True],
+                    "c": [True, False, True, True, False, True],

Review comment:
       Thank you, updated. Sorry about my again mistake!




-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org