@@ -4000,7 +4000,7 @@ def assign(self, **kwargs) -> DataFrame:
40004000 data [k ] = com .apply_if_callable (v , data )
40014001 return data
40024002
4003- def _sanitize_column (self , value ):
4003+ def _sanitize_column (self , value ) -> ArrayLike :
40044004 """
40054005 Ensures new columns (which go into the BlockManager as new blocks) are
40064006 always copied and converted into an array.
@@ -4011,7 +4011,7 @@ def _sanitize_column(self, value):
40114011
40124012 Returns
40134013 -------
4014- numpy.ndarray
4014+ numpy.ndarray or ExtensionArray
40154015 """
40164016 self ._ensure_valid_index (value )
40174017
@@ -4025,7 +4025,7 @@ def _sanitize_column(self, value):
40254025 value = value .copy ()
40264026 value = sanitize_index (value , self .index )
40274027
4028- elif isinstance ( value , Index ) or is_sequence (value ):
4028+ elif is_sequence (value ):
40294029
40304030 # turn me into an ndarray
40314031 value = sanitize_index (value , self .index )
@@ -4035,7 +4035,7 @@ def _sanitize_column(self, value):
40354035 else :
40364036 value = com .asarray_tuplesafe (value )
40374037 elif isinstance (value , Index ):
4038- value = value .copy (deep = True )
4038+ value = value .copy (deep = True ). _values
40394039 else :
40404040 value = value .copy ()
40414041
0 commit comments