From 8b6a73d0fb8bfcede7b84ce7a2984c4efdf7f9f6 Mon Sep 17 00:00:00 2001 From: Vivian Nguyen Date: Mon, 5 Feb 2024 19:15:29 -0600 Subject: [PATCH] Clean _get_pyagg --- tiledb/multirange_indexing.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tiledb/multirange_indexing.py b/tiledb/multirange_indexing.py index b8c1df8184..5e17c01bc2 100644 --- a/tiledb/multirange_indexing.py +++ b/tiledb/multirange_indexing.py @@ -640,13 +640,8 @@ def _get_pyquery( return pyquery -def _get_pyagg(array: Array, agg: Optional[AggregationProxy]) -> PyAgg: - schema = array.schema - if agg: - order = agg.query.order - else: - # set default order: TILEDB_UNORDERED for sparse, TILEDB_ROW_MAJOR for dense - order = "U" if schema.sparse else "C" +def _get_pyagg(array: Array, agg: AggregationProxy) -> PyAgg: + order = agg.query.order try: layout = "CFGU".index(order) @@ -657,10 +652,8 @@ def _get_pyagg(array: Array, agg: Optional[AggregationProxy]) -> PyAgg: ) pyagg = PyAgg(array._ctx_(), array, layout, agg.attr_to_aggs) - if agg.query.cond is not None: pyagg.set_cond(QueryCondition(agg.query.cond)) - return pyagg