@@ -103,19 +103,23 @@ class TestTableSchemaType:
103
103
@pytest .mark .parametrize ("int_type" , [np .int , np .int16 , np .int32 , np .int64 ])
104
104
def test_as_json_table_type_int_data (self , int_type ):
105
105
int_data = [1 , 2 , 3 ]
106
- assert as_json_table_type (np .array (int_data , dtype = int_type )) == "integer"
106
+ assert as_json_table_type (np .array (int_data , dtype = int_type ). dtype ) == "integer"
107
107
108
108
@pytest .mark .parametrize (
109
109
"float_type" , [np .float , np .float16 , np .float32 , np .float64 ]
110
110
)
111
111
def test_as_json_table_type_float_data (self , float_type ):
112
112
float_data = [1.0 , 2.0 , 3.0 ]
113
- assert as_json_table_type (np .array (float_data , dtype = float_type )) == "number"
113
+ assert (
114
+ as_json_table_type (np .array (float_data , dtype = float_type ).dtype ) == "number"
115
+ )
114
116
115
117
@pytest .mark .parametrize ("bool_type" , [bool , np .bool ])
116
118
def test_as_json_table_type_bool_data (self , bool_type ):
117
119
bool_data = [True , False ]
118
- assert as_json_table_type (np .array (bool_data , dtype = bool_type )) == "boolean"
120
+ assert (
121
+ as_json_table_type (np .array (bool_data , dtype = bool_type ).dtype ) == "boolean"
122
+ )
119
123
120
124
@pytest .mark .parametrize (
121
125
"date_data" ,
@@ -128,11 +132,11 @@ def test_as_json_table_type_bool_data(self, bool_type):
128
132
],
129
133
)
130
134
def test_as_json_table_type_date_data (self , date_data ):
131
- assert as_json_table_type (date_data ) == "datetime"
135
+ assert as_json_table_type (date_data . dtype ) == "datetime"
132
136
133
137
@pytest .mark .parametrize ("str_data" , [pd .Series (["a" , "b" ]), pd .Index (["a" , "b" ])])
134
138
def test_as_json_table_type_string_data (self , str_data ):
135
- assert as_json_table_type (str_data ) == "string"
139
+ assert as_json_table_type (str_data . dtype ) == "string"
136
140
137
141
@pytest .mark .parametrize (
138
142
"cat_data" ,
@@ -145,7 +149,7 @@ def test_as_json_table_type_string_data(self, str_data):
145
149
],
146
150
)
147
151
def test_as_json_table_type_categorical_data (self , cat_data ):
148
- assert as_json_table_type (cat_data ) == "any"
152
+ assert as_json_table_type (cat_data . dtype ) == "any"
149
153
150
154
# ------
151
155
# dtypes
@@ -189,7 +193,7 @@ def test_as_json_table_type_categorical_dtypes(self):
189
193
# TODO: I think before is_categorical_dtype(Categorical)
190
194
# returned True, but now it's False. Figure out why or
191
195
# if it matters
192
- assert as_json_table_type (pd .Categorical (["a" ])) == "any"
196
+ assert as_json_table_type (pd .Categorical (["a" ]). dtype ) == "any"
193
197
assert as_json_table_type (CategoricalDtype ()) == "any"
194
198
195
199
0 commit comments