File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -805,17 +805,17 @@ def as_array(
805
805
# mutating the original object
806
806
copy = copy or na_value is not lib .no_default
807
807
808
- if self ._is_single_block and self . blocks [ 0 ]. is_extension :
809
- # Avoid implicit conversion of extension blocks to object
810
- arr = (
811
- self . blocks [ 0 ]
812
- .values .to_numpy (dtype = dtype , na_value = na_value )
813
- . reshape ( self . blocks [ 0 ]. shape )
814
- )
815
- elif self . _is_single_block :
816
- arr = np .asarray (self . blocks [ 0 ] .get_values ())
817
- if dtype :
818
- arr = arr .astype (dtype , copy = False )
808
+ if self ._is_single_block :
809
+ blk = self . blocks [ 0 ]
810
+ if blk . is_extension :
811
+ # Avoid implicit conversion of extension blocks to object
812
+ arr = blk .values .to_numpy (dtype = dtype , na_value = na_value ). reshape (
813
+ blk . shape
814
+ )
815
+ else :
816
+ arr = np .asarray (blk .get_values ())
817
+ if dtype :
818
+ arr = arr .astype (dtype , copy = False )
819
819
else :
820
820
arr = self ._interleave (dtype = dtype , na_value = na_value )
821
821
# The underlying data was copied within _interleave
You can’t perform that action at this time.
0 commit comments