Skip to content

Commit b3edefa

Browse files
Update _mixins.py
Make ruff happy by raising from `exc`. Signed-off-by: Michael Tiemann <[email protected]>
1 parent be1f02b commit b3edefa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/arrays/_mixins.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ def __setitem__(self, key, value) -> None:
264264
except TypeError as exc:
265265
# Don't let Python's handling of `complex` make extra complexity for Pandas
266266
if self._ndarray.dtype.kind == "c":
267-
raise ValueError(*(x.replace("real", "complex") for x in exc.args))
267+
raise ValueError(
268+
*(x.replace("real", "complex") for x in exc.args)
269+
) from exc
268270
raise exc
269271

270272
def _validate_setitem_value(self, value):

0 commit comments

Comments
 (0)