26
26
27
27
TABLE_ID = "new_test"
28
28
PANDAS_VERSION = pkg_resources .parse_version (pandas .__version__ )
29
- NULLABLE_INT_PANDAS_VERSION = pkg_resources .parse_version ("0.24.0" )
30
- NULLABLE_INT_MESSAGE = "Require pandas 0.24+ in order to use nullable integer type."
31
29
32
30
33
31
def test_imports ():
@@ -173,9 +171,6 @@ def test_should_properly_handle_valid_integers(self, project_id):
173
171
tm .assert_frame_equal (df , DataFrame ({"valid_integer" : [3 ]}))
174
172
175
173
def test_should_properly_handle_nullable_integers (self , project_id ):
176
- if PANDAS_VERSION < NULLABLE_INT_PANDAS_VERSION :
177
- pytest .skip (msg = NULLABLE_INT_MESSAGE )
178
-
179
174
query = """SELECT * FROM
180
175
UNNEST([1, NULL]) AS nullable_integer
181
176
"""
@@ -188,9 +183,7 @@ def test_should_properly_handle_nullable_integers(self, project_id):
188
183
)
189
184
tm .assert_frame_equal (
190
185
df ,
191
- DataFrame (
192
- {"nullable_integer" : pandas .Series ([1 , pandas .NA ], dtype = "Int64" )}
193
- ),
186
+ DataFrame ({"nullable_integer" : pandas .Series ([1 , None ], dtype = "Int64" )}),
194
187
)
195
188
196
189
def test_should_properly_handle_valid_longs (self , project_id ):
@@ -204,9 +197,6 @@ def test_should_properly_handle_valid_longs(self, project_id):
204
197
tm .assert_frame_equal (df , DataFrame ({"valid_long" : [1 << 62 ]}))
205
198
206
199
def test_should_properly_handle_nullable_longs (self , project_id ):
207
- if PANDAS_VERSION < NULLABLE_INT_PANDAS_VERSION :
208
- pytest .skip (msg = NULLABLE_INT_MESSAGE )
209
-
210
200
query = """SELECT * FROM
211
201
UNNEST([1 << 62, NULL]) AS nullable_long
212
202
"""
@@ -219,15 +209,10 @@ def test_should_properly_handle_nullable_longs(self, project_id):
219
209
)
220
210
tm .assert_frame_equal (
221
211
df ,
222
- DataFrame (
223
- {"nullable_long" : pandas .Series ([1 << 62 , pandas .NA ], dtype = "Int64" )}
224
- ),
212
+ DataFrame ({"nullable_long" : pandas .Series ([1 << 62 , None ], dtype = "Int64" )}),
225
213
)
226
214
227
215
def test_should_properly_handle_null_integers (self , project_id ):
228
- if PANDAS_VERSION < NULLABLE_INT_PANDAS_VERSION :
229
- pytest .skip (msg = NULLABLE_INT_MESSAGE )
230
-
231
216
query = "SELECT CAST(NULL AS INT64) AS null_integer"
232
217
df = gbq .read_gbq (
233
218
query ,
@@ -237,7 +222,7 @@ def test_should_properly_handle_null_integers(self, project_id):
237
222
dtypes = {"null_integer" : "Int64" },
238
223
)
239
224
tm .assert_frame_equal (
240
- df , DataFrame ({"null_integer" : pandas .Series ([pandas . NA ], dtype = "Int64" )}),
225
+ df , DataFrame ({"null_integer" : pandas .Series ([None ], dtype = "Int64" )}),
241
226
)
242
227
243
228
def test_should_properly_handle_valid_floats (self , project_id ):
0 commit comments