3636import numba
3737import sdc
3838from sdc .tests .test_utils import (count_array_REPs , count_parfor_REPs , count_parfor_OneDs ,
39- count_array_OneDs , dist_IR_contains , get_start_end , check_numba_version )
39+ count_array_OneDs , dist_IR_contains , get_start_end , check_numba_version ,
40+ skip_numba_jit , TestCase )
4041
4142from sdc .tests .gen_test_data import ParquetGenerator
4243from numba .config import IS_32BITS
@@ -52,7 +53,7 @@ def inner_get_column(df):
5253COL_IND = 0
5354
5455
55- class TestDataFrame (unittest . TestCase ):
56+ class TestDataFrame (TestCase ):
5657
5758 def test_create1 (self ):
5859 def test_impl (n ):
@@ -149,6 +150,7 @@ def test_impl(df):
149150 df = pd .DataFrame ({'A' : ['aa' , 'bb' , 'cc' ]})
150151 pd .testing .assert_frame_equal (hpat_func (df ), test_impl (df ))
151152
153+ @skip_numba_jit
152154 def test_box_categorical (self ):
153155 def test_impl (df ):
154156 df ['A' ] = df ['A' ] + 1
@@ -201,6 +203,7 @@ def test_impl(n):
201203 self .assertEqual (count_array_REPs (), 0 )
202204 self .assertEqual (count_parfor_REPs (), 0 )
203205
206+ @skip_numba_jit
204207 def test_column_getitem1 (self ):
205208 def test_impl (n ):
206209 df = pd .DataFrame ({'A' : np .ones (n ), 'B' : np .random .ranf (n )})
@@ -224,6 +227,7 @@ def test_impl(df):
224227 {'A' : np .arange (n ), 'B' : np .ones (n ), 'C' : np .random .ranf (n )})
225228 pd .testing .assert_frame_equal (hpat_func (df ), test_impl (df ))
226229
230+ @skip_numba_jit
227231 def test_filter1 (self ):
228232 def test_impl (n ):
229233 df = pd .DataFrame ({'A' : np .arange (n ) + n , 'B' : np .arange (n )** 2 })
@@ -236,6 +240,7 @@ def test_impl(n):
236240 self .assertEqual (count_array_REPs (), 0 )
237241 self .assertEqual (count_parfor_REPs (), 0 )
238242
243+ @skip_numba_jit
239244 def test_filter2 (self ):
240245 def test_impl (n ):
241246 df = pd .DataFrame ({'A' : np .arange (n ) + n , 'B' : np .arange (n )** 2 })
@@ -248,6 +253,7 @@ def test_impl(n):
248253 self .assertEqual (count_array_REPs (), 0 )
249254 self .assertEqual (count_parfor_REPs (), 0 )
250255
256+ @skip_numba_jit
251257 def test_filter3 (self ):
252258 def test_impl (n ):
253259 df = pd .DataFrame ({'A' : np .arange (n ) + n , 'B' : np .arange (n )** 2 })
@@ -260,6 +266,7 @@ def test_impl(n):
260266 self .assertEqual (count_array_REPs (), 0 )
261267 self .assertEqual (count_parfor_REPs (), 0 )
262268
269+ @skip_numba_jit
263270 def test_iloc1 (self ):
264271 def test_impl (df , n ):
265272 return df .iloc [1 :n ].B .values
@@ -269,6 +276,7 @@ def test_impl(df, n):
269276 df = pd .DataFrame ({'A' : np .arange (n ), 'B' : np .arange (n )** 2 })
270277 np .testing .assert_array_equal (hpat_func (df , n ), test_impl (df , n ))
271278
279+ @skip_numba_jit
272280 def test_iloc2 (self ):
273281 def test_impl (df , n ):
274282 return df .iloc [np .array ([1 , 4 , 9 ])].B .values
@@ -424,6 +432,7 @@ def test_impl(df, n):
424432 do_check = False if platform .system () == 'Windows' and not IS_32BITS else True
425433 pd .testing .assert_frame_equal (df1 , df2 , check_dtype = do_check )
426434
435+ @skip_numba_jit
427436 def test_set_column_bool1 (self ):
428437 def test_impl (df ):
429438 df ['C' ] = df ['A' ][df ['B' ]]
@@ -489,6 +498,7 @@ def test_impl(n):
489498 self .assertEqual (count_array_REPs (), 0 )
490499 self .assertEqual (count_parfor_REPs (), 0 )
491500
501+ @skip_numba_jit
492502 def test_df_apply (self ):
493503 def test_impl (n ):
494504 df = pd .DataFrame ({'A' : np .arange (n ), 'B' : np .arange (n )})
@@ -499,6 +509,7 @@ def test_impl(n):
499509 hpat_func = sdc .jit (test_impl )
500510 np .testing .assert_almost_equal (hpat_func (n ), test_impl (n ))
501511
512+ @skip_numba_jit
502513 def test_df_apply_branch (self ):
503514 def test_impl (n ):
504515 df = pd .DataFrame ({'A' : np .arange (n ), 'B' : np .arange (n )})
@@ -523,6 +534,7 @@ def test_impl(n):
523534 self .assertEqual (count_array_REPs (), 0 )
524535 self .assertEqual (count_parfor_REPs (), 0 )
525536
537+ @skip_numba_jit
526538 def test_sort_values (self ):
527539 def test_impl (df ):
528540 df .sort_values ('A' , inplace = True )
@@ -534,6 +546,7 @@ def test_impl(df):
534546 hpat_func = sdc .jit (test_impl )
535547 np .testing .assert_almost_equal (hpat_func (df .copy ()), test_impl (df ))
536548
549+ @skip_numba_jit
537550 def test_sort_values_copy (self ):
538551 def test_impl (df ):
539552 df2 = df .sort_values ('A' )
@@ -545,6 +558,7 @@ def test_impl(df):
545558 hpat_func = sdc .jit (test_impl )
546559 np .testing .assert_almost_equal (hpat_func (df .copy ()), test_impl (df ))
547560
561+ @skip_numba_jit
548562 def test_sort_values_single_col (self ):
549563 def test_impl (df ):
550564 df .sort_values ('A' , inplace = True )
@@ -556,6 +570,7 @@ def test_impl(df):
556570 hpat_func = sdc .jit (test_impl )
557571 np .testing .assert_almost_equal (hpat_func (df .copy ()), test_impl (df ))
558572
573+ @skip_numba_jit
559574 def test_sort_values_single_col_str (self ):
560575 def test_impl (df ):
561576 df .sort_values ('A' , inplace = True )
@@ -573,6 +588,7 @@ def test_impl(df):
573588 hpat_func = sdc .jit (test_impl )
574589 self .assertTrue ((hpat_func (df .copy ()) == test_impl (df )).all ())
575590
591+ @skip_numba_jit
576592 def test_sort_values_str (self ):
577593 def test_impl (df ):
578594 df .sort_values ('A' , inplace = True )
@@ -596,6 +612,7 @@ def test_impl(df):
596612 hpat_func = sdc .jit (test_impl )
597613 self .assertTrue ((hpat_func (df ) == sorted_df .B .values ).all ())
598614
615+ @skip_numba_jit
599616 def test_sort_parallel_single_col (self ):
600617 # create `kde.parquet` file
601618 ParquetGenerator .gen_kde_pq ()
@@ -671,6 +688,7 @@ def test_impl(df):
671688 })
672689 pd .testing .assert_frame_equal (hpat_func (df ), test_impl (df ))
673690
691+ @skip_numba_jit
674692 def test_sort_parallel (self ):
675693 # create `kde.parquet` file
676694 ParquetGenerator .gen_kde_pq ()
@@ -730,6 +748,7 @@ def test_impl(n):
730748 n = 11
731749 self .assertEqual (hpat_func (n ), test_impl (n ))
732750
751+ @skip_numba_jit
733752 def test_itertuples_analysis (self ):
734753 """tests array analysis handling of generated tuples, shapes going
735754 through blocks and getting used in an array dimension
@@ -757,6 +776,7 @@ def test_impl(n):
757776 n = 11
758777 pd .testing .assert_frame_equal (hpat_func (n ), test_impl (n ))
759778
779+ @skip_numba_jit
760780 def test_pct_change1 (self ):
761781 def test_impl (n ):
762782 df = pd .DataFrame ({'A' : np .arange (n ) + 1.0 , 'B' : np .arange (n ) + 1 })
@@ -909,6 +929,7 @@ def test_impl():
909929 hpat_func = sdc .jit (test_impl )
910930 pd .testing .assert_frame_equal (hpat_func (), test_impl ())
911931
932+ @skip_numba_jit
912933 def test_df_dropna1 (self ):
913934 def test_impl (df ):
914935 return df .dropna ()
@@ -919,6 +940,7 @@ def test_impl(df):
919940 h_out = hpat_func (df )
920941 pd .testing .assert_frame_equal (out , h_out )
921942
943+ @skip_numba_jit
922944 def test_df_dropna2 (self ):
923945 def test_impl (df ):
924946 return df .dropna ()
@@ -929,6 +951,7 @@ def test_impl(df):
929951 h_out = hpat_func (df )
930952 pd .testing .assert_frame_equal (out , h_out )
931953
954+ @skip_numba_jit
932955 def test_df_dropna_inplace1 (self ):
933956 # TODO: fix error when no df is returned
934957 def test_impl (df ):
@@ -942,6 +965,7 @@ def test_impl(df):
942965 h_out = hpat_func (df2 )
943966 pd .testing .assert_frame_equal (out , h_out )
944967
968+ @skip_numba_jit
945969 def test_df_dropna_str1 (self ):
946970 def test_impl (df ):
947971 return df .dropna ()
@@ -952,6 +976,7 @@ def test_impl(df):
952976 h_out = hpat_func (df )
953977 pd .testing .assert_frame_equal (out , h_out )
954978
979+ @skip_numba_jit
955980 def test_df_drop1 (self ):
956981 def test_impl (df ):
957982 return df .drop (columns = ['A' ])
@@ -960,6 +985,7 @@ def test_impl(df):
960985 hpat_func = sdc .jit (test_impl )
961986 pd .testing .assert_frame_equal (hpat_func (df ), test_impl (df ))
962987
988+ @skip_numba_jit
963989 def test_df_drop_inplace2 (self ):
964990 # test droping after setting the column
965991 def test_impl (df ):
@@ -1014,6 +1040,7 @@ def test_impl(df):
10141040 df = pd .DataFrame ({'A' : np .arange (n ), 'B' : np .arange (n )** 2 })
10151041 pd .testing .assert_frame_equal (hpat_func (df ), test_impl (df ))
10161042
1043+ @skip_numba_jit
10171044 def test_append1 (self ):
10181045 def test_impl (df , df2 ):
10191046 return df .append (df2 , ignore_index = True )
@@ -1025,6 +1052,7 @@ def test_impl(df, df2):
10251052 df2 .A [n // 2 :] = n
10261053 pd .testing .assert_frame_equal (hpat_func (df , df2 ), test_impl (df , df2 ))
10271054
1055+ @skip_numba_jit
10281056 def test_append2 (self ):
10291057 def test_impl (df , df2 , df3 ):
10301058 return df .append ([df2 , df3 ], ignore_index = True )
@@ -1038,6 +1066,7 @@ def test_impl(df, df2, df3):
10381066 pd .testing .assert_frame_equal (
10391067 hpat_func (df , df2 , df3 ), test_impl (df , df2 , df3 ))
10401068
1069+ @skip_numba_jit
10411070 def test_concat_columns1 (self ):
10421071 def test_impl (S1 , S2 ):
10431072 return pd .concat ([S1 , S2 ], axis = 1 )
0 commit comments