xinrong-databricks commented on a change in pull request #35888:
URL: https://github.com/apache/spark/pull/35888#discussion_r830710981



##########
File path: python/pyspark/pandas/frame.py
##########
@@ -10117,6 +10126,21 @@ def all(self, axis: Axis = 0) -> "Series":
 
         applied = []
         column_labels = self._internal.column_labels
+
+        if bool_only:
+            bool_column_labels = []
+            for label in column_labels:
+                psser = self._psser_for(label)
+                if is_bool_dtype(psser):
+                    # Rely on dtype rather than spark type because
+                    # columns that consist of bools and Nones should be 
excluded
+                    # if bool_only is True
+                    bool_column_labels.append(label)
+            column_labels = bool_column_labels
+
+        if len(column_labels) == 0:
+            return ps.Series([], dtype=bool)

Review comment:
       Be consistent with pandas' API.




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