@@ -734,14 +734,8 @@ def _maybe_mask_setitem_value(self, indexer, value):
734734
735735 if is_scalar_indexer (icols , self .ndim - 1 ) and ndim == 1 :
736736 # e.g. test_loc_setitem_boolean_mask_allfalse
737- if len (newkey ) == 0 :
738- # FIXME: kludge for test_loc_setitem_boolean_mask_allfalse
739- # TODO(GH#45333): may be fixed when deprecation is enforced
740-
741- value = value .iloc [:0 ]
742- else :
743- # test_loc_setitem_ndframe_values_alignment
744- value = self .obj .iloc ._align_series (indexer , value )
737+ # test_loc_setitem_ndframe_values_alignment
738+ value = self .obj .iloc ._align_series (indexer , value )
745739 indexer = (newkey , icols )
746740
747741 elif (
@@ -757,14 +751,8 @@ def _maybe_mask_setitem_value(self, indexer, value):
757751 indexer = (newkey , icols )
758752
759753 elif ndim == 2 and value .shape [1 ] == 1 :
760- if len (newkey ) == 0 :
761- # FIXME: kludge for
762- # test_loc_setitem_all_false_boolean_two_blocks
763- # TODO(GH#45333): may be fixed when deprecation is enforced
764- value = value .iloc [:0 ]
765- else :
766- # test_loc_setitem_ndframe_values_alignment
767- value = self .obj .iloc ._align_frame (indexer , value )
754+ # test_loc_setitem_ndframe_values_alignment
755+ value = self .obj .iloc ._align_frame (indexer , value )
768756 indexer = (newkey , icols )
769757 elif com .is_bool_indexer (indexer ):
770758 indexer = indexer .nonzero ()[0 ]
@@ -2255,7 +2243,7 @@ def ravel(i):
22552243 new_ix = Index ([new_ix ])
22562244 else :
22572245 new_ix = Index (new_ix )
2258- if ser .index .equals (new_ix ) or not len ( new_ix ) :
2246+ if ser .index .equals (new_ix ):
22592247 return ser ._values .copy ()
22602248
22612249 return ser .reindex (new_ix )._values
0 commit comments