Skip to content

Commit dd193d8

Browse files
jbrockmendeljreback
authored andcommitted
CLN: Exception in NDFrame._maybe_update_cacher (#29066)
1 parent 7b8e22d commit dd193d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/generic.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3340,9 +3340,13 @@ def _maybe_update_cacher(self, clear=False, verify_is_copy=True):
33403340
if ref is None:
33413341
del self._cacher
33423342
else:
3343+
# Note: we need to call ref._maybe_cache_changed even in the
3344+
# case where it will raise. (Uh, not clear why)
33433345
try:
33443346
ref._maybe_cache_changed(cacher[0], self)
3345-
except Exception:
3347+
except AssertionError:
3348+
# ref._data.setitem can raise
3349+
# AssertionError because of shape mismatch
33463350
pass
33473351

33483352
if verify_is_copy:

0 commit comments

Comments
 (0)