@@ -3865,7 +3865,7 @@ def _set_value(
3865
3865
loc = self .index .get_loc (index )
3866
3866
validate_numeric_casting (series .dtype , value )
3867
3867
3868
- series ._values [ loc ] = value
3868
+ series ._mgr . setitem_inplace ( loc , value )
3869
3869
# Note: trying to use series._set_value breaks tests in
3870
3870
# tests.frame.indexing.test_indexing and tests.indexing.test_partial
3871
3871
except (KeyError , TypeError ):
@@ -3908,7 +3908,7 @@ def _box_col_values(self, values: SingleDataManager, loc: int) -> Series:
3908
3908
name = self .columns [loc ]
3909
3909
klass = self ._constructor_sliced
3910
3910
# We get index=self.index bc values is a SingleDataManager
3911
- return klass (values , name = name , fastpath = True )
3911
+ return klass (values , name = name , fastpath = True ). __finalize__ ( self )
3912
3912
3913
3913
# ----------------------------------------------------------------------
3914
3914
# Lookup Caching
@@ -3925,11 +3925,9 @@ def _get_item_cache(self, item: Hashable) -> Series:
3925
3925
# pending resolution of GH#33047
3926
3926
3927
3927
loc = self .columns .get_loc (item )
3928
- col_mgr = self ._mgr .iget (loc )
3929
- res = self ._box_col_values (col_mgr , loc ).__finalize__ (self )
3928
+ res = self ._ixs (loc , axis = 1 )
3930
3929
3931
3930
cache [item ] = res
3932
- res ._set_as_cached (item , self )
3933
3931
3934
3932
# for a chain
3935
3933
res ._is_copy = self ._is_copy
0 commit comments