37
37
from sdc .tests .test_base import TestCase
38
38
from sdc .tests .test_utils import (
39
39
count_array_REPs , count_parfor_REPs , count_array_OneDs , get_start_end ,
40
- skip_numba_jit , skip_sdc_jit , sdc_limitation )
40
+ skip_numba_jit , skip_sdc_jit , sdc_limitation , skip_parallel , skip_inline )
41
41
from sdc .tests .gen_test_data import ParquetGenerator
42
42
from numba import types
43
43
from numba .config import IS_32BITS
@@ -612,6 +612,7 @@ def test_impl(A, deep):
612
612
self .assertEqual (actual .index is S .index , expected .index is S .index )
613
613
self .assertEqual (actual .index is S .index , not deep )
614
614
615
+ @skip_parallel
615
616
@skip_sdc_jit ('Series.corr() parameter "min_periods" unsupported' )
616
617
def test_series_corr (self ):
617
618
def test_series_corr_impl (S1 , S2 , min_periods = None ):
@@ -679,6 +680,8 @@ def test_series_corr_impl(S1, S2, min_periods=None):
679
680
msg = 'Method corr(). The object min_periods'
680
681
self .assertIn (msg , str (raises .exception ))
681
682
683
+ @skip_parallel
684
+ @skip_inline
682
685
def test_series_astype_int_to_str1 (self ):
683
686
'''Verifies Series.astype implementation with function 'str' as argument
684
687
converts integer series to series of strings
@@ -691,6 +694,8 @@ def test_impl(S):
691
694
S = pd .Series (np .arange (n ))
692
695
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
693
696
697
+ @skip_parallel
698
+ @skip_inline
694
699
def test_series_astype_int_to_str2 (self ):
695
700
'''Verifies Series.astype implementation with a string literal dtype argument
696
701
converts integer series to series of strings
@@ -703,6 +708,8 @@ def test_impl(S):
703
708
S = pd .Series (np .arange (n ))
704
709
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
705
710
711
+ @skip_parallel
712
+ @skip_inline
706
713
def test_series_astype_str_to_str1 (self ):
707
714
'''Verifies Series.astype implementation with function 'str' as argument
708
715
handles string series not changing it
@@ -714,6 +721,8 @@ def test_impl(S):
714
721
S = pd .Series (['aa' , 'bb' , 'cc' ])
715
722
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
716
723
724
+ @skip_parallel
725
+ @skip_inline
717
726
def test_series_astype_str_to_str2 (self ):
718
727
'''Verifies Series.astype implementation with a string literal dtype argument
719
728
handles string series not changing it
@@ -725,6 +734,8 @@ def test_impl(S):
725
734
S = pd .Series (['aa' , 'bb' , 'cc' ])
726
735
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
727
736
737
+ @skip_parallel
738
+ @skip_inline
728
739
def test_series_astype_str_to_str_index_str (self ):
729
740
'''Verifies Series.astype implementation with function 'str' as argument
730
741
handles string series not changing it
@@ -738,6 +749,8 @@ def test_impl(S):
738
749
S = pd .Series (['aa' , 'bb' , 'cc' ], index = ['d' , 'e' , 'f' ])
739
750
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
740
751
752
+ @skip_parallel
753
+ @skip_inline
741
754
def test_series_astype_str_to_str_index_int (self ):
742
755
'''Verifies Series.astype implementation with function 'str' as argument
743
756
handles string series not changing it
@@ -857,6 +870,8 @@ def test_impl(A):
857
870
S = pd .Series (['3.24' , '1E+05' , '-1' , '-1.3E-01' , 'nan' , 'inf' ])
858
871
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
859
872
873
+ @skip_parallel
874
+ @skip_inline
860
875
def test_series_astype_str_index_str (self ):
861
876
'''Verifies Series.astype implementation with function 'str' as argument
862
877
handles string series not changing it
@@ -869,6 +884,8 @@ def test_impl(S):
869
884
S = pd .Series (['aa' , 'bb' , 'cc' ], index = ['a' , 'b' , 'c' ])
870
885
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
871
886
887
+ @skip_parallel
888
+ @skip_inline
872
889
def test_series_astype_str_index_int (self ):
873
890
'''Verifies Series.astype implementation with function 'str' as argument
874
891
handles string series not changing it
@@ -1462,6 +1479,7 @@ def test_impl(A):
1462
1479
df = pd .DataFrame ({'A' : np .arange (n )})
1463
1480
self .assertTrue (isinstance (hpat_func (df .A ), np .ndarray ))
1464
1481
1482
+ @skip_parallel
1465
1483
@skip_sdc_jit ('No support of axis argument in old-style Series.fillna() impl' )
1466
1484
def test_series_fillna_axis1 (self ):
1467
1485
'''Verifies Series.fillna() implementation handles 'index' as axis argument'''
@@ -1472,6 +1490,7 @@ def test_impl(S):
1472
1490
S = pd .Series ([1.0 , 2.0 , np .nan , 1.0 , np .inf ])
1473
1491
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1474
1492
1493
+ @skip_parallel
1475
1494
@skip_sdc_jit ('No support of axis argument in old-style Series.fillna() impl' )
1476
1495
def test_series_fillna_axis2 (self ):
1477
1496
'''Verifies Series.fillna() implementation handles 0 as axis argument'''
@@ -1482,6 +1501,7 @@ def test_impl(S):
1482
1501
S = pd .Series ([1.0 , 2.0 , np .nan , 1.0 , np .inf ])
1483
1502
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1484
1503
1504
+ @skip_parallel
1485
1505
@skip_sdc_jit ('No support of axis argument in old-style Series.fillna() impl' )
1486
1506
def test_series_fillna_axis3 (self ):
1487
1507
'''Verifies Series.fillna() implementation handles correct non-literal axis argument'''
@@ -1493,6 +1513,7 @@ def test_impl(S, axis):
1493
1513
for axis in [0 , 'index' ]:
1494
1514
pd .testing .assert_series_equal (hpat_func (S , axis ), test_impl (S , axis ))
1495
1515
1516
+ @skip_parallel
1496
1517
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1497
1518
def test_series_fillna_float_from_df (self ):
1498
1519
'''Verifies Series.fillna() applied to a named float Series obtained from a DataFrame'''
@@ -1504,6 +1525,7 @@ def test_impl(S):
1504
1525
df = pd .DataFrame ({'A' : [1.0 , 2.0 , np .nan , 1.0 , np .inf ]})
1505
1526
pd .testing .assert_series_equal (hpat_func (df .A ), test_impl (df .A ), check_names = False )
1506
1527
1528
+ @skip_parallel
1507
1529
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1508
1530
def test_series_fillna_float_index1 (self ):
1509
1531
'''Verifies Series.fillna() implementation for float series with default index'''
@@ -1515,6 +1537,7 @@ def test_impl(S):
1515
1537
S = pd .Series (data )
1516
1538
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1517
1539
1540
+ @skip_parallel
1518
1541
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1519
1542
def test_series_fillna_float_index2 (self ):
1520
1543
'''Verifies Series.fillna() implementation for float series with string index'''
@@ -1525,6 +1548,7 @@ def test_impl(S):
1525
1548
S = pd .Series ([1.0 , 2.0 , np .nan , 1.0 , np .inf ], ['a' , 'b' , 'c' , 'd' , 'e' ])
1526
1549
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1527
1550
1551
+ @skip_parallel
1528
1552
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1529
1553
def test_series_fillna_float_index3 (self ):
1530
1554
def test_impl (S ):
@@ -1534,6 +1558,8 @@ def test_impl(S):
1534
1558
S = pd .Series ([1.0 , 2.0 , np .nan , 1.0 , np .inf ], index = [1 , 2 , 5 , 7 , 10 ])
1535
1559
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1536
1560
1561
+ @skip_parallel
1562
+ @skip_inline
1537
1563
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1538
1564
def test_series_fillna_str_from_df (self ):
1539
1565
'''Verifies Series.fillna() applied to a named float Series obtained from a DataFrame'''
@@ -1546,6 +1572,8 @@ def test_impl(S):
1546
1572
pd .testing .assert_series_equal (hpat_func (df .A ),
1547
1573
test_impl (df .A ), check_names = False )
1548
1574
1575
+ @skip_parallel
1576
+ @skip_inline
1549
1577
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1550
1578
def test_series_fillna_str_index1 (self ):
1551
1579
'''Verifies Series.fillna() implementation for series of strings with default index'''
@@ -1556,6 +1584,8 @@ def test_impl(S):
1556
1584
S = pd .Series (['aa' , 'b' , None , 'cccd' , '' ])
1557
1585
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1558
1586
1587
+ @skip_parallel
1588
+ @skip_inline
1559
1589
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1560
1590
def test_series_fillna_str_index2 (self ):
1561
1591
'''Verifies Series.fillna() implementation for series of strings with string index'''
@@ -1566,6 +1596,8 @@ def test_impl(S):
1566
1596
S = pd .Series (['aa' , 'b' , None , 'cccd' , '' ], ['a' , 'b' , 'c' , 'd' , 'e' ])
1567
1597
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1568
1598
1599
+ @skip_parallel
1600
+ @skip_inline
1569
1601
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1570
1602
def test_series_fillna_str_index3 (self ):
1571
1603
def test_impl (S ):
@@ -1576,6 +1608,7 @@ def test_impl(S):
1576
1608
S = pd .Series (['aa' , 'b' , None , 'cccd' , '' ], index = [1 , 2 , 5 , 7 , 10 ])
1577
1609
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1578
1610
1611
+ @skip_parallel
1579
1612
@skip_sdc_jit ('BUG: old-style fillna impl returns series without index' )
1580
1613
def test_series_fillna_float_inplace1 (self ):
1581
1614
'''Verifies Series.fillna() implementation for float series with default index and inplace argument True'''
@@ -1588,6 +1621,7 @@ def test_impl(S):
1588
1621
S2 = S1 .copy ()
1589
1622
pd .testing .assert_series_equal (hpat_func (S1 ), test_impl (S2 ))
1590
1623
1624
+ @skip_parallel
1591
1625
@unittest .skip ('TODO: add reflection support and check method return value' )
1592
1626
def test_series_fillna_float_inplace2 (self ):
1593
1627
'''Verifies Series.fillna(inplace=True) results are reflected back in the original float series'''
@@ -1601,6 +1635,7 @@ def test_impl(S):
1601
1635
self .assertIsNone (test_impl (S2 ))
1602
1636
pd .testing .assert_series_equal (S1 , S2 )
1603
1637
1638
+ @skip_parallel
1604
1639
def test_series_fillna_float_inplace3 (self ):
1605
1640
'''Verifies Series.fillna() implementation correcly handles omitted inplace argument as default False'''
1606
1641
def test_impl (S ):
@@ -1612,6 +1647,7 @@ def test_impl(S):
1612
1647
pd .testing .assert_series_equal (hpat_func (S1 ), test_impl (S1 ))
1613
1648
pd .testing .assert_series_equal (S1 , S2 )
1614
1649
1650
+ @skip_parallel
1615
1651
def test_series_fillna_inplace_non_literal (self ):
1616
1652
'''Verifies Series.fillna() implementation handles only Boolean literals as inplace argument'''
1617
1653
def test_impl (S , param ):
@@ -1623,6 +1659,7 @@ def test_impl(S, param):
1623
1659
expected = ValueError if sdc .config .config_pipeline_hpat_default else TypingError
1624
1660
self .assertRaises (expected , hpat_func , S , True )
1625
1661
1662
+ @skip_parallel
1626
1663
@skip_numba_jit ('TODO: investigate why Numba types inplace as bool (non-literal value)' )
1627
1664
def test_series_fillna_str_inplace1 (self ):
1628
1665
'''Verifies Series.fillna() implementation for series of strings
@@ -1687,6 +1724,7 @@ def test_impl(S):
1687
1724
S = pd .Series ([pd .NaT , pd .Timestamp ('1970-12-01' ), pd .Timestamp ('2012-07-25' )])
1688
1725
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
1689
1726
1727
+ @skip_parallel
1690
1728
def test_series_fillna_bool_no_index1 (self ):
1691
1729
'''Verifies Series.fillna() implementation for bool series with default index'''
1692
1730
def test_impl (S ):
@@ -2570,6 +2608,7 @@ def test_impl(S):
2570
2608
S = pd .Series ([np .nan , - 2. , 3. , 0.5E-01 , 0xFF , 0o7 , 0b101 ])
2571
2609
pd .testing .assert_series_equal (hpat_func (S ), test_impl (S ))
2572
2610
2611
+ @skip_parallel
2573
2612
def test_series_cov1 (self ):
2574
2613
def test_impl (S1 , S2 ):
2575
2614
return S1 .cov (S2 )
@@ -4021,6 +4060,7 @@ def test_impl(A, B):
4021
4060
B = np .random .ranf (n )
4022
4061
pd .testing .assert_series_equal (hpat_func (A , B ), test_impl (A , B ))
4023
4062
4063
+ @skip_parallel
4024
4064
def test_series_sort_values_full (self ):
4025
4065
def test_impl (series , ascending , kind ):
4026
4066
return series .sort_values (axis = 0 , ascending = ascending , inplace = False , kind = kind , na_position = 'last' )
@@ -4068,6 +4108,7 @@ def test_impl(series, ascending, kind):
4068
4108
np .testing .assert_array_equal (ref_result .data , jit_result .data )
4069
4109
self .assertEqual (ref , jit )
4070
4110
4111
+ @skip_parallel
4071
4112
def test_series_sort_values_full_idx (self ):
4072
4113
def test_impl (series , ascending , kind ):
4073
4114
return series .sort_values (axis = 0 , ascending = ascending , inplace = False , kind = kind , na_position = 'last' )
@@ -4688,6 +4729,7 @@ def test_series_count_impl(S):
4688
4729
result = hpat_func (S )
4689
4730
self .assertEqual (result , result_ref )
4690
4731
4732
+ @skip_parallel
4691
4733
@skip_sdc_jit ('Series.cumsum() np.nan as input data unsupported' )
4692
4734
def test_series_cumsum (self ):
4693
4735
def test_impl ():
@@ -4698,6 +4740,7 @@ def test_impl():
4698
4740
cfunc = self .jit (pyfunc )
4699
4741
pd .testing .assert_series_equal (pyfunc (), cfunc ())
4700
4742
4743
+ @skip_parallel
4701
4744
@skip_sdc_jit ('Series.cumsum() np.nan as input data unsupported' )
4702
4745
def test_series_cumsum_unboxing (self ):
4703
4746
def test_impl (s ):
@@ -4710,6 +4753,7 @@ def test_impl(s):
4710
4753
series = pd .Series (data )
4711
4754
pd .testing .assert_series_equal (pyfunc (series ), cfunc (series ))
4712
4755
4756
+ @skip_parallel
4713
4757
@skip_sdc_jit ('Series.cumsum() parameters "axis", "skipna" unsupported' )
4714
4758
def test_series_cumsum_full (self ):
4715
4759
def test_impl (s , axis , skipna ):
@@ -4751,6 +4795,7 @@ def test_impl(s, axis):
4751
4795
msg = 'Method cumsum(). Unsupported parameters. Given axis: int'
4752
4796
self .assertIn (msg , str (raises .exception ))
4753
4797
4798
+ @skip_parallel
4754
4799
@skip_sdc_jit ('Series.cov() parameter "min_periods" unsupported' )
4755
4800
def test_series_cov (self ):
4756
4801
def test_series_cov_impl (S1 , S2 , min_periods = None ):
@@ -5146,6 +5191,7 @@ def test_impl(A, B):
5146
5191
B = pd .Series (np .arange (n )** 2 , index = np .arange (n , dtype = dtype_right ))
5147
5192
pd .testing .assert_series_equal (hpat_func (A , B ), test_impl (A , B ), check_dtype = False )
5148
5193
5194
+ @skip_parallel
5149
5195
@skip_sdc_jit ('Arithmetic operations on Series with non-default indexes are not supported in old-style' )
5150
5196
def test_series_operator_add_numeric_same_index_numeric_fixme (self ):
5151
5197
""" Same as test_series_operator_add_same_index_numeric but with w/a for the problem.
@@ -5167,6 +5213,7 @@ def test_impl(A, B):
5167
5213
B = pd .Series (np .arange (n )** 2 , index = np .arange (n , dtype = dtype_right ))
5168
5214
pd .testing .assert_series_equal (hpat_func (A , B ), test_impl (A , B ), check_dtype = False )
5169
5215
5216
+ @skip_parallel
5170
5217
@skip_sdc_jit ('Arithmetic operations on Series with non-default indexes are not supported in old-style' )
5171
5218
def test_series_operator_add_numeric_same_index_str (self ):
5172
5219
"""Verifies implementation of Series.operator.add between two numeric Series with the same string indexes"""
@@ -5179,6 +5226,7 @@ def test_impl(A, B):
5179
5226
B = pd .Series (np .arange (n )** 2 , index = ['a' , 'c' , 'e' , 'c' , 'b' , 'a' , 'o' ])
5180
5227
pd .testing .assert_series_equal (hpat_func (A , B ), test_impl (A , B ), check_dtype = False , check_names = False )
5181
5228
5229
+ @skip_parallel
5182
5230
@skip_sdc_jit ('Arithmetic operations on Series with non-default indexes are not supported in old-style' )
5183
5231
def test_series_operator_add_numeric_align_index_int (self ):
5184
5232
"""Verifies implementation of Series.operator.add between two numeric Series with non-equal integer indexes"""
@@ -5195,6 +5243,7 @@ def test_impl(A, B):
5195
5243
B = pd .Series (np .arange (n )** 2 , index = index_B )
5196
5244
pd .testing .assert_series_equal (hpat_func (A , B ), test_impl (A , B ), check_dtype = False , check_names = False )
5197
5245
5246
+ @skip_parallel
5198
5247
@skip_sdc_jit ('Arithmetic operations on Series with non-default indexes are not supported in old-style' )
5199
5248
def test_series_operator_add_numeric_align_index_str (self ):
5200
5249
"""Verifies implementation of Series.operator.add between two numeric Series with non-equal string indexes"""
@@ -5228,6 +5277,7 @@ def test_impl(A, B):
5228
5277
B = pd .Series (np .arange (n )** 2 , index = index_B )
5229
5278
pd .testing .assert_series_equal (hpat_func (A , B ), test_impl (A , B ), check_dtype = False , check_names = False )
5230
5279
5280
+ @skip_parallel
5231
5281
@skip_sdc_jit ('Arithmetic operations on Series with non-default indexes are not supported in old-style' )
5232
5282
def test_series_operator_add_numeric_align_index_other_dtype (self ):
5233
5283
"""Verifies implementation of Series.operator.add between two numeric Series
@@ -5253,6 +5303,7 @@ def test_impl(A, B):
5253
5303
B = pd .Series (np .arange (size_B )** 2 )
5254
5304
pd .testing .assert_series_equal (hpat_func (A , B ), test_impl (A , B ), check_dtype = False , check_names = False )
5255
5305
5306
+ @skip_parallel
5256
5307
@skip_sdc_jit ('Arithmetic operations on Series requiring alignment of indexes are not supported in old-style' )
5257
5308
def test_series_operator_add_align_index_int_capacity (self ):
5258
5309
"""Verifies implementation of Series.operator.add and alignment of numeric indexes of large size"""
0 commit comments