@@ -1783,12 +1783,26 @@ def test_combine_first(
1783
1783
pd .testing .assert_frame_equal (bf_result , pd_result , check_dtype = False )
1784
1784
1785
1785
1786
- def test_corr_w_numeric_only (scalars_dfs ):
1787
- columns = ["int64_too" , "int64_col" , "float64_col" ]
1786
+ @pytest .mark .parametrize (
1787
+ ("columns" , "numeric_only" ),
1788
+ [
1789
+ (["bool_col" , "int64_col" , "float64_col" , "numeric_col" ], True ),
1790
+ (["bool_col" , "int64_col" , "float64_col" , "numeric_col" ], False ),
1791
+ (["bool_col" , "int64_col" , "float64_col" , "numeric_col" , "string_col" ], True ),
1792
+ pytest .param (
1793
+ ["bool_col" , "int64_col" , "float64_col" , "numeric_col" , "string_col" ],
1794
+ False ,
1795
+ marks = pytest .mark .xfail (
1796
+ raises = NotImplementedError ,
1797
+ ),
1798
+ ),
1799
+ ],
1800
+ )
1801
+ def test_corr_w_numeric_only (scalars_dfs , columns , numeric_only ):
1788
1802
scalars_df , scalars_pandas_df = scalars_dfs
1789
1803
1790
- bf_result = scalars_df [columns ].corr (numeric_only = True ).to_pandas ()
1791
- pd_result = scalars_pandas_df [columns ].corr (numeric_only = True )
1804
+ bf_result = scalars_df [columns ].corr (numeric_only = numeric_only ).to_pandas ()
1805
+ pd_result = scalars_pandas_df [columns ].corr (numeric_only = numeric_only )
1792
1806
1793
1807
# BigFrames and Pandas differ in their data type handling:
1794
1808
# - Column types: BigFrames uses Float64, Pandas uses float64.
@@ -1808,9 +1822,6 @@ def test_corr_w_invalid_parameters(scalars_dfs):
1808
1822
with pytest .raises (NotImplementedError ):
1809
1823
scalars_df [columns ].corr (min_periods = 1 )
1810
1824
1811
- with pytest .raises (NotImplementedError ):
1812
- scalars_df [columns ].corr (numeric_only = False )
1813
-
1814
1825
1815
1826
@pytest .mark .parametrize (
1816
1827
("op" ),
0 commit comments