File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -635,16 +635,19 @@ def test_values_with_tz_dtypes(self):
635
635
["B" , "B" ],
636
636
]:
637
637
df_sub = df [col ]
638
+ arr = df_sub .values
638
639
640
+ self .assert (type (arr )== numpy .ndarray )
641
+
639
642
# array has the same dtype as dataframe only and only if
640
- # - dataframe has a single column
641
- # - or all columns are of type datetime64[ns]
643
+ # - all columns are of type datetime64[ns]
642
644
643
645
# TODO: replace 2nd condition by 'all columns are of type datetime64[ns,same timezone]'
644
646
# i.e. the test should succeed when replacing the condition be `if len(set(df_sub.dtypes.values))==1:`
645
- if len (df_sub .dtypes ) == 1 or all (df_sub .dtypes .values == "<M8[ns]" ):
646
- self .assertTrue (df_sub .values .dtype == df_sub .dtypes .values [0 ])
647
+ # too complex before 2.0 as DatetimeTZBlock is single column
648
+ if all (df_sub .dtypes .values == "<M8[ns]" ):
649
+ self .assertTrue (arr .dtype == df_sub .dtypes .values [0 ])
647
650
648
651
# otherwise, dtype is object
649
652
else :
650
- self .assertTrue (df_sub . values .dtype == object )
653
+ self .assertTrue (arr .dtype == object )
You can’t perform that action at this time.
0 commit comments