@@ -2140,6 +2140,12 @@ def _setitem_single_block(self, indexer, value, name: str) -> None:
2140
2140
"""
2141
2141
from pandas import Series
2142
2142
2143
+ if (isinstance (value , ABCSeries ) and name != "iloc" ) or isinstance (value , dict ):
2144
+ # TODO(EA): ExtensionBlock.setitem this causes issues with
2145
+ # setting for extensionarrays that store dicts. Need to decide
2146
+ # if it's worth supporting that.
2147
+ value = self ._align_series (indexer , Series (value ))
2148
+
2143
2149
info_axis = self .obj ._info_axis_number
2144
2150
item_labels = self .obj ._get_axis (info_axis )
2145
2151
if isinstance (indexer , tuple ):
@@ -2160,13 +2166,7 @@ def _setitem_single_block(self, indexer, value, name: str) -> None:
2160
2166
2161
2167
indexer = maybe_convert_ix (* indexer ) # e.g. test_setitem_frame_align
2162
2168
2163
- if (isinstance (value , ABCSeries ) and name != "iloc" ) or isinstance (value , dict ):
2164
- # TODO(EA): ExtensionBlock.setitem this causes issues with
2165
- # setting for extensionarrays that store dicts. Need to decide
2166
- # if it's worth supporting that.
2167
- value = self ._align_series (indexer , Series (value ))
2168
-
2169
- elif isinstance (value , ABCDataFrame ) and name != "iloc" :
2169
+ if isinstance (value , ABCDataFrame ) and name != "iloc" :
2170
2170
value = self ._align_frame (indexer , value )._values
2171
2171
2172
2172
# check for chained assignment
0 commit comments