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/16 17:48:33 UTC

[GitHub] [spark] dgd-contributor commented on a change in pull request #34005: [SPARK-36762][PYTHON] Fix Series.isin when Series has NaN values

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



##########
File path: python/pyspark/pandas/base.py
##########
@@ -873,7 +873,11 @@ def isin(self: IndexOpsLike, values: Sequence[Any]) -> IndexOpsLike:
             )
 
         values = values.tolist() if isinstance(values, np.ndarray) else list(values)
-        return self._with_new_scol(self.spark.column.isin([SF.lit(v) for v in values]))
+
+        other = [SF.lit(v) for v in values]
+        scol = self.spark.column.isin(other)
+
+        return self._with_new_scol(F.when(scol.isNull(), False).otherwise(scol))

Review comment:
       thank you, done.




-- 
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