Skip to content

Commit 9442a04

Browse files
author
Daniel Saxton
committed
Narrow exception catching
1 parent 2067c1a commit 9442a04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/apply.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def apply_empty_result(self):
206206
if not should_reduce:
207207
try:
208208
r = self.f(Series([]))
209-
except Exception:
209+
except (TypeError, KeyError):
210210
pass
211211
else:
212212
should_reduce = not isinstance(r, Series)

0 commit comments

Comments
 (0)