ray.data.aggregate.AggregateFnV2.aggregate_block#

abstract AggregateFnV2.aggregate_block(block: pyarrow.Table | pandas.DataFrame) AggType[source]#

Aggregates data within a single block.

This method processes all rows in a given Block and returns a partial aggregation result for that block. For instance, if implementing a sum, this method would sum all relevant values within the block.

Parameters:

block – A Block of data to be aggregated.

Returns:

A partial aggregation result for the input block. The type of this result (AggType) should be consistent with the current_accumulator and new arguments of the combine method, and the accumulator argument of the _finalize method.