Skip to content

Commit e87c298

Browse files
committed
Signed-off-by: Arthur <atte.book@gmail.com>
1 parent bf2686b commit e87c298

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/ray/data/aggregate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def __init__(
540540
zero_factory=lambda: list([0, 0]), # noqa: C410
541541
)
542542

543-
def aggregate_block(self, block: Block) -> List[Union[int, float]]:
543+
def aggregate_block(self, block: Block) -> Optional[List[Union[int, float]]]:
544544
block_acc = BlockAccessor.for_block(block)
545545
count = block_acc.count(self._target_col_name, self._ignore_nulls)
546546

@@ -568,7 +568,7 @@ def finalize(self, accumulator: List[Union[int, float]]) -> Optional[float]:
568568
if accumulator[1] == 0:
569569
# If total_count is 0 (e.g., group was empty or all nulls ignored),
570570
# the mean is undefined. Return NaN
571-
return np.nan
571+
return np.nan[
572572

573573
return accumulator[0] / accumulator[1]
574574

@@ -724,7 +724,7 @@ def __init__(
724724
zero_factory=lambda: 0,
725725
)
726726

727-
def aggregate_block(self, block: Block) -> Union[int, float]:
727+
def aggregate_block(self, block: Block) -> Optional[Union[int, float]]:
728728
block_accessor = BlockAccessor.for_block(block)
729729

730730
max_ = block_accessor.max(self._target_col_name, self._ignore_nulls)

0 commit comments

Comments
 (0)