@@ -1916,6 +1916,34 @@ def test_corr_w_invalid_parameters(scalars_dfs):
1916
1916
scalars_df [columns ].corr (min_periods = 1 )
1917
1917
1918
1918
1919
+ @pytest .mark .parametrize (
1920
+ ("columns" , "numeric_only" ),
1921
+ [
1922
+ (["bool_col" , "int64_col" , "float64_col" ], True ),
1923
+ (["bool_col" , "int64_col" , "float64_col" ], False ),
1924
+ (["bool_col" , "int64_col" , "float64_col" , "string_col" ], True ),
1925
+ pytest .param (
1926
+ ["bool_col" , "int64_col" , "float64_col" , "string_col" ],
1927
+ False ,
1928
+ marks = pytest .mark .xfail (
1929
+ raises = NotImplementedError ,
1930
+ ),
1931
+ ),
1932
+ ],
1933
+ )
1934
+ def test_cov_w_numeric_only (scalars_dfs , columns , numeric_only ):
1935
+ scalars_df , scalars_pandas_df = scalars_dfs
1936
+ bf_result = scalars_df [columns ].cov (numeric_only = numeric_only ).to_pandas ()
1937
+ pd_result = scalars_pandas_df [columns ].cov (numeric_only = numeric_only )
1938
+
1939
+ # BigFrames and Pandas differ in their data type handling:
1940
+ # - Column types: BigFrames uses Float64, Pandas uses float64.
1941
+ # - Index types: BigFrames uses strign, Pandas uses object.
1942
+ pd .testing .assert_frame_equal (
1943
+ bf_result , pd_result , check_dtype = False , check_index_type = False
1944
+ )
1945
+
1946
+
1919
1947
@pytest .mark .parametrize (
1920
1948
("op" ),
1921
1949
[
0 commit comments