@@ -57,7 +57,10 @@ def test_mixed_intfloatbool(df_factory):
57
57
58
58
with pytest .raises (TypeError ):
59
59
assert df2 .__dataframe__ ().get_column_by_name ("y" ).describe_categorical
60
- assert df2 .__dataframe__ ().get_column_by_name ("y" ).describe_null == (3 , 1 )
60
+ if df2 ['y' ].dtype .is_arrow :
61
+ assert df2 .__dataframe__ ().get_column_by_name ("y" ).describe_null == (3 , 0 )
62
+ else :
63
+ assert df2 .__dataframe__ ().get_column_by_name ("y" ).describe_null == (0 , None )
61
64
62
65
assert_dataframe_equal (df .__dataframe__ (), df )
63
66
@@ -127,17 +130,17 @@ def test_categorical_ordinal():
127
130
col = df .__dataframe__ ().get_column_by_name ("colors" )
128
131
assert col .dtype [0 ] == _DtypeKind .CATEGORICAL
129
132
assert col .describe_categorical == (False , True , {0 : "red" , 1 : "green" , 2 : "blue" })
130
- assert col .describe_null == (3 , 1 )
133
+ assert col .describe_null == (0 , None )
131
134
assert col .dtype == (23 , 64 , "u" , "=" )
132
135
col2 = df .__dataframe__ ().get_column_by_name ("year" )
133
136
assert col2 .dtype [0 ] == _DtypeKind .CATEGORICAL
134
137
assert col2 .describe_categorical == (False , True , {0 : 2012 , 1 : 2013 , 2 : 2014 , 3 : 2015 , 4 : 2016 , 5 : 2017 , 6 : 2018 , 7 : 2019 })
135
- assert col2 .describe_null == (3 , 1 )
138
+ assert col2 .describe_null == (0 , None )
136
139
assert col2 .dtype == (23 , 64 , "u" , "=" )
137
140
col3 = df .__dataframe__ ().get_column_by_name ("weekday" )
138
141
assert col3 .dtype [0 ] == _DtypeKind .CATEGORICAL
139
142
assert col3 .describe_categorical == (False , True , {0 : "Mon" , 1 : "Tue" , 2 : "Wed" , 3 : "Thu" , 4 : "Fri" , 5 : "Sat" , 6 : "Sun" })
140
- assert col3 .describe_null == (3 , 1 )
143
+ assert col3 .describe_null == (0 , None )
141
144
assert col3 .dtype == (23 , 64 , "u" , "=" )
142
145
143
146
df2 = _from_dataframe_to_vaex (df .__dataframe__ ())
@@ -158,7 +161,10 @@ def test_arrow_dictionary():
158
161
col = df .__dataframe__ ().get_column_by_name ("x" )
159
162
assert col .dtype [0 ] == _DtypeKind .CATEGORICAL
160
163
assert col .describe_categorical == (False , True , {0 : "foo" , 1 : "bar" , 2 : "baz" })
161
- assert col .describe_null == (3 , 1 )
164
+ if df ['x' ].dtype .is_arrow :
165
+ assert col .describe_null == (3 , 0 )
166
+ else :
167
+ assert col .describe_null == (0 , None )
162
168
assert col .dtype == (23 , 64 , "u" , "=" )
163
169
164
170
df2 = _from_dataframe_to_vaex (df .__dataframe__ ())
0 commit comments