From b077df93de2128b41a86c90f174b0b4649dfd6c9 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Sat, 10 Aug 2024 16:06:35 -0500 Subject: [PATCH] update regr_count tests for new return type Ref: https://github.com/apache/datafusion/pull/11731 --- python/datafusion/tests/test_functions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/datafusion/tests/test_functions.py b/python/datafusion/tests/test_functions.py index 29391232..b8ad9c0d 100644 --- a/python/datafusion/tests/test_functions.py +++ b/python/datafusion/tests/test_functions.py @@ -808,7 +808,7 @@ def test_regr_funcs_sql(df): assert result[0].column(0) == pa.array([None], type=pa.float64()) assert result[0].column(1) == pa.array([None], type=pa.float64()) - assert result[0].column(2) == pa.array([1], type=pa.float64()) + assert result[0].column(2) == pa.array([1], type=pa.uint64()) assert result[0].column(3) == pa.array([None], type=pa.float64()) assert result[0].column(4) == pa.array([1], type=pa.float64()) assert result[0].column(5) == pa.array([1], type=pa.float64()) @@ -840,7 +840,7 @@ def test_regr_funcs_sql_2(): # Assertions for SQL results assert result_sql[0].column(0) == pa.array([2], type=pa.float64()) assert result_sql[0].column(1) == pa.array([0], type=pa.float64()) - assert result_sql[0].column(2) == pa.array([3], type=pa.float64()) # todo: i would not expect this to be float + assert result_sql[0].column(2) == pa.array([3], type=pa.uint64()) assert result_sql[0].column(3) == pa.array([1], type=pa.float64()) assert result_sql[0].column(4) == pa.array([2], type=pa.float64()) assert result_sql[0].column(5) == pa.array([4], type=pa.float64()) @@ -852,7 +852,7 @@ def test_regr_funcs_sql_2(): @pytest.mark.parametrize("func, expected", [ pytest.param(f.regr_slope, pa.array([2], type=pa.float64()), id="regr_slope"), pytest.param(f.regr_intercept, pa.array([0], type=pa.float64()), id="regr_intercept"), - pytest.param(f.regr_count, pa.array([3], type=pa.float64()), id="regr_count"), # TODO: I would expect this to return an int array + pytest.param(f.regr_count, pa.array([3], type=pa.uint64()), id="regr_count"), pytest.param(f.regr_r2, pa.array([1], type=pa.float64()), id="regr_r2"), pytest.param(f.regr_avgx, pa.array([2], type=pa.float64()), id="regr_avgx"), pytest.param(f.regr_avgy, pa.array([4], type=pa.float64()), id="regr_avgy"),