From 7211ba634717e0187661701403264b3e67005a65 Mon Sep 17 00:00:00 2001 From: Michael-J-Ward Date: Thu, 25 Jul 2024 14:47:28 -0500 Subject: [PATCH] remove trailing todos --- python/datafusion/functions.py | 3 +-- python/datafusion/tests/test_aggregation.py | 2 +- src/common/data_type.rs | 1 - src/functions.rs | 2 -- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/python/datafusion/functions.py b/python/datafusion/functions.py index 51753d64..61113bdb 100644 --- a/python/datafusion/functions.py +++ b/python/datafusion/functions.py @@ -1246,11 +1246,10 @@ def approx_median(arg: Expr, distinct: bool = False) -> Expr: def approx_percentile_cont( expression: Expr, percentile: Expr, - # num_centroids: int | None = None, distinct: bool = False, ) -> Expr: """Returns the value that is approximately at a given percentile of ``expr``.""" - # TODO: enable num_centroids + # Re-enable num_centroids: https://github.com/apache/datafusion-python/issues/777 num_centroids = None if num_centroids is None: return Expr( diff --git a/python/datafusion/tests/test_aggregation.py b/python/datafusion/tests/test_aggregation.py index b169b829..c10e5f36 100644 --- a/python/datafusion/tests/test_aggregation.py +++ b/python/datafusion/tests/test_aggregation.py @@ -79,7 +79,7 @@ def test_built_in_aggregation(df): assert result.column(0) == pa.array([2], type=pa.uint64()) assert result.column(1) == pa.array([4]) assert result.column(2) == pa.array([4]) - # TODO: new approx_percentile_cont is returning a DoubleArray instead of Int64Array + # Ref: https://github.com/apache/datafusion-python/issues/777 # assert result.column(3) == pa.array([6]) assert result.column(4) == pa.array([[4, 4, 6]]) np.testing.assert_array_almost_equal(result.column(5), np.average(values_a)) diff --git a/src/common/data_type.rs b/src/common/data_type.rs index 27eb076c..469bb789 100644 --- a/src/common/data_type.rs +++ b/src/common/data_type.rs @@ -248,7 +248,6 @@ impl DataTypeMap { } /// Maps a `ScalarValue` to an Arrow `DataType` - /// TODO: Why not just use `ScalarValue::data_type`? pub fn map_from_scalar_to_arrow(scalar_val: &ScalarValue) -> Result { match scalar_val { ScalarValue::Boolean(_) => Ok(DataType::Boolean), diff --git a/src/functions.rs b/src/functions.rs index 5d8e0fe7..de329bb5 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -44,7 +44,6 @@ pub fn approx_distinct(expression: PyExpr) -> PyExpr { #[pyfunction] pub fn approx_median(expression: PyExpr, distinct: bool) -> PyResult { - // TODO: better builder pattern let expr = functions_aggregate::expr_fn::approx_median(expression.expr); if distinct { Ok(expr.distinct().build()?.into()) @@ -59,7 +58,6 @@ pub fn approx_percentile_cont( percentile: PyExpr, distinct: bool, ) -> PyResult { - // TODO: better builder pattern let expr = functions_aggregate::expr_fn::approx_percentile_cont(expression.expr, percentile.expr); if distinct {