Skip to content

Commit

Permalink
Clean _get_pyagg
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenv committed Feb 6, 2024
1 parent 5ea1536 commit 8b6a73d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tiledb/multirange_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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


Expand Down

0 comments on commit 8b6a73d

Please sign in to comment.