@@ -264,25 +264,26 @@ def get_reindexed_values(self, empty_dtype: DtypeObj, upcasted_na) -> ArrayLike:
264
264
fill_value = upcasted_na
265
265
266
266
if self .is_na :
267
- if getattr (self .block , "is_object" , False ):
267
+ blk_dtype = getattr (self .block , "dtype" , None )
268
+
269
+ if blk_dtype == np .dtype (object ):
268
270
# we want to avoid filling with np.nan if we are
269
271
# using None; we already know that we are all
270
272
# nulls
271
273
values = self .block .values .ravel (order = "K" )
272
274
if len (values ) and values [0 ] is None :
273
275
fill_value = None
274
276
275
- if getattr ( self . block , "is_datetimetz" , False ) or is_datetime64tz_dtype (
277
+ if is_datetime64tz_dtype ( blk_dtype ) or is_datetime64tz_dtype (
276
278
empty_dtype
277
279
):
278
280
if self .block is None :
279
281
# TODO(EA2D): special case unneeded with 2D EAs
280
- return DatetimeArray (
281
- np .full (self .shape [1 ], fill_value .value ), dtype = empty_dtype
282
- )
283
- elif getattr (self .block , "is_categorical" , False ):
282
+ i8values = np .full (self .shape [1 ], fill_value .value )
283
+ return DatetimeArray (i8values , dtype = empty_dtype )
284
+ elif is_categorical_dtype (blk_dtype ):
284
285
pass
285
- elif getattr ( self . block , "is_extension" , False ):
286
+ elif is_extension_array_dtype ( blk_dtype ):
286
287
pass
287
288
elif is_extension_array_dtype (empty_dtype ):
288
289
missing_arr = empty_dtype .construct_array_type ()._from_sequence (
0 commit comments