test_regr_funcs in test_functions.py uses a ctx.sql(query) statement, which bypasses the datafusion-python functions it should be testing.
| deftest_regr_funcs(df): |
| # test case base on |
| # https://github.com/apache/arrow-datafusion/blob/d1361d56b9a9e0c165d3d71a8df6795d2a5f51dd/datafusion/core/tests/sqllogictests/test_files/aggregate.slt#L2330 |
| ctx=SessionContext() |
| result=ctx.sql( |
| "select regr_slope(1,1), regr_intercept(1,1), " |
| "regr_count(1,1), regr_r2(1,1), regr_avgx(1,1), " |
| "regr_avgy(1,1), regr_sxx(1,1), regr_syy(1,1), " |
| "regr_sxy(1,1);" |
| ).collect() |
| |
| assertresult[0].column(0) ==pa.array([None], type=pa.float64()) |
| assertresult[0].column(1) ==pa.array([None], type=pa.float64()) |
| assertresult[0].column(2) ==pa.array([1], type=pa.float64()) |
| assertresult[0].column(3) ==pa.array([None], type=pa.float64()) |
| assertresult[0].column(4) ==pa.array([1], type=pa.float64()) |
| assertresult[0].column(5) ==pa.array([1], type=pa.float64()) |
| assertresult[0].column(6) ==pa.array([0], type=pa.float64()) |
| assertresult[0].column(7) ==pa.array([0], type=pa.float64()) |
| assertresult[0].column(8) ==pa.array([0], type=pa.float64()) |
test_regr_funcsintest_functions.pyuses actx.sql(query)statement, which bypasses thedatafusion-pythonfunctions it should be testing.datafusion-python/python/datafusion/tests/test_functions.py
Lines 834 to 853 in fd6b4df