Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions python/pyspark/pandas/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -11262,15 +11262,9 @@ def _bool_column_labels(self, column_labels: List[Label]) -> List[Label]:
"""
Filter column labels of boolean columns (without None).
"""
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)
return bool_column_labels
# Rely on dtype rather than spark type because columns that consist of bools and
# Nones should be excluded if bool_only is True
return [label for label in column_labels if is_bool_dtype(self._psser_for(label))]

def _result_aggregated(
self, column_labels: List[Label], scols: Sequence[PySparkColumn]
Expand Down