Backport PR #25102 on branch 0.24.x (BUG: Fixing regression in DataFrame.all and DataFrame.any with bool_only=True)
Backport PR #25102: BUG: Fixing regression in DataFrame.all and DataFrame.any with bool_only=True