Skip to content

Commit

Permalink
remove trailing todos
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-J-Ward committed Jul 25, 2024
1 parent 22f372b commit 7211ba6
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions python/datafusion/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion python/datafusion/tests/test_aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 0 additions & 1 deletion src/common/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DataType, PyErr> {
match scalar_val {
ScalarValue::Boolean(_) => Ok(DataType::Boolean),
Expand Down
2 changes: 0 additions & 2 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pub fn approx_distinct(expression: PyExpr) -> PyExpr {

#[pyfunction]
pub fn approx_median(expression: PyExpr, distinct: bool) -> PyResult<PyExpr> {
// TODO: better builder pattern
let expr = functions_aggregate::expr_fn::approx_median(expression.expr);
if distinct {
Ok(expr.distinct().build()?.into())
Expand All @@ -59,7 +58,6 @@ pub fn approx_percentile_cont(
percentile: PyExpr,
distinct: bool,
) -> PyResult<PyExpr> {
// TODO: better builder pattern
let expr =
functions_aggregate::expr_fn::approx_percentile_cont(expression.expr, percentile.expr);
if distinct {
Expand Down

0 comments on commit 7211ba6

Please sign in to comment.