@@ -78,7 +78,7 @@ def all_(*functions):
78
78
return functools .partial (do_all , functions )
79
79
80
80
81
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
81
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
82
82
def test_is_datetime ():
83
83
assert is_datetime (pyarrow .timestamp ("us" , tz = None ))
84
84
assert not is_datetime (pyarrow .timestamp ("ms" , tz = None ))
@@ -242,15 +242,15 @@ def test_all_():
242
242
("UNKNOWN_TYPE" , "REPEATED" , is_none ),
243
243
],
244
244
)
245
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
245
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
246
246
def test_bq_to_arrow_data_type (module_under_test , bq_type , bq_mode , is_correct_type ):
247
247
field = schema .SchemaField ("ignored_name" , bq_type , mode = bq_mode )
248
248
actual = module_under_test .bq_to_arrow_data_type (field )
249
249
assert is_correct_type (actual )
250
250
251
251
252
252
@pytest .mark .parametrize ("bq_type" , ["RECORD" , "record" , "STRUCT" , "struct" ])
253
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
253
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
254
254
def test_bq_to_arrow_data_type_w_struct (module_under_test , bq_type ):
255
255
fields = (
256
256
schema .SchemaField ("field01" , "STRING" ),
@@ -294,7 +294,7 @@ def test_bq_to_arrow_data_type_w_struct(module_under_test, bq_type):
294
294
295
295
296
296
@pytest .mark .parametrize ("bq_type" , ["RECORD" , "record" , "STRUCT" , "struct" ])
297
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
297
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
298
298
def test_bq_to_arrow_data_type_w_array_struct (module_under_test , bq_type ):
299
299
fields = (
300
300
schema .SchemaField ("field01" , "STRING" ),
@@ -338,7 +338,7 @@ def test_bq_to_arrow_data_type_w_array_struct(module_under_test, bq_type):
338
338
assert actual .value_type .equals (expected_value_type )
339
339
340
340
341
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
341
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
342
342
def test_bq_to_arrow_data_type_w_struct_unknown_subfield (module_under_test ):
343
343
fields = (
344
344
schema .SchemaField ("field1" , "STRING" ),
@@ -434,8 +434,8 @@ def test_bq_to_arrow_data_type_w_struct_unknown_subfield(module_under_test):
434
434
),
435
435
],
436
436
)
437
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
438
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
437
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
438
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
439
439
def test_bq_to_arrow_array_w_nullable_scalars (module_under_test , bq_type , rows ):
440
440
series = pandas .Series (rows
F440
span>, dtype = "object" )
441
441
bq_field = schema .SchemaField ("field_name" , bq_type )
@@ -444,8 +444,8 @@ def test_bq_to_arrow_array_w_nullable_scalars(module_under_test, bq_type, rows):
444
444
assert rows == roundtrip
445
445
446
446
447
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
448
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
447
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
448
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
449
449
def test_bq_to_arrow_array_w_arrays (module_under_test ):
450
450
rows = [[1 , 2 , 3 ], [], [4 , 5 , 6 ]]
451
451
series = pandas .Series (rows , dtype = "object" )
@@ -456,8 +456,8 @@ def test_bq_to_arrow_array_w_arrays(module_under_test):
456
456
457
457
458
458
@pytest .mark .parametrize ("bq_type" , ["RECORD" , "record" , "STRUCT" , "struct" ])
459
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
460
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
459
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
460
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
461
461
def test_bq_to_arrow_array_w_structs (module_under_test , bq_type ):
462
462
rows = [
463
463
{"int_col" : 123 , "string_col" : "abc" },
@@ -478,8 +478,8 @@ def test_bq_to_arrow_array_w_structs(module_under_test, bq_type):
478
478
assert rows == roundtrip
479
479
480
480
481
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
482
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
481
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
482
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
483
483
def test_bq_to_arrow_array_w_special_floats (module_under_test ):
484
484
bq_field = schema .SchemaField ("field_name" , "FLOAT64" )
485
485
rows = [float ("-inf" ), float ("nan" ), float ("inf" ), None ]
@@ -493,7 +493,7 @@ def test_bq_to_arrow_array_w_special_floats(module_under_test):
493
493
assert roundtrip [3 ] is None
494
494
495
495
496
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
496
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
497
497
def test_bq_to_arrow_schema_w_unknown_type (module_under_test ):
498
498
fields = (
499
499
schema .SchemaField ("field1" , "STRING" ),
@@ -506,8 +506,8 @@ def test_bq_to_arrow_schema_w_unknown_type(module_under_test):
506
506
assert actual is None
507
507
508
508
509
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
510
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
509
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
510
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
511
511
def test_dataframe_to_arrow_w_required_fields (module_under_test ):
512
512
bq_schema = (
513
513
schema .SchemaField ("field01" , "STRING" , mode = "REQUIRED" ),
@@ -561,8 +561,8 @@ def test_dataframe_to_arrow_w_required_fields(module_under_test):
561
561
assert not arrow_field .nullable
562
562
563
563
564
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
565
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
564
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
565
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
566
566
def test_dataframe_to_arrow_w_unknown_type (module_under_test ):
567
567
bq_schema = (
568
568
schema .SchemaField ("field00" , "UNKNOWN_TYPE" ),
@@ -594,16 +594,16 @@ def test_dataframe_to_arrow_w_unknown_type(module_under_test):
594
594
assert arrow_schema [3 ].name == "field03"
595
595
596
596
597
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
597
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
598
598
def test_dataframe_to_parquet_without_pyarrow (module_under_test , monkeypatch ):
599
599
monkeypatch .setattr (module_under_test , "pyarrow" , None )
600
600
with pytest .raises (ValueError ) as exc_context :
601
601
module_under_test .dataframe_to_parquet (pandas .DataFrame (), (), None )
602
602
assert "pyarrow is required" in str (exc_context .value )
603
603
604
604
605
- @pytest .mark .skipIf (pandas is None , "Requires `pandas`" )
606
- @pytest .mark .skipIf (pyarrow is None , "Requires `pyarrow`" )
605
+ @pytest .mark .skipif (pandas is None , reason = "Requires `pandas`" )
606
+ @pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
607
607
def test_dataframe_to_parquet_w_missing_columns (module_under_test , monkeypatch ):
608
608
with pytest .raises (ValueError ) as exc_context :
609
609
module_under_test .dataframe_to_parquet (
0 commit comments