Skip to content
Prev Previous commit
Structure with elif instead
  • Loading branch information
mzeitlin11 committed Sep 12, 2021
commit 0ce141bc4466ff805574a1709f8af3b0ab76e79c
7 changes: 3 additions & 4 deletions pandas/core/arrays/sparse/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,11 +1515,10 @@ def _min_max(self, kind: Literal["min", "max"]) -> Scalar:
return func(sp_min_max, self.fill_value)
else:
return sp_min_max
elif has_nonnull_fill_vals:
return self.fill_value
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might has well just do elif else

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, updated

if has_nonnull_fill_vals:
return self.fill_value
else:
return na_value_for_dtype(self.dtype.subtype)
return na_value_for_dtype(self.dtype.subtype)

# ------------------------------------------------------------------------
# Ufuncs
Expand Down