Skip to content

Commit

Permalink
[Data] Clean up ray.data.aggregate namespace (ray-project#36468)
Browse files Browse the repository at this point in the history
This cleans up code completion for the ray.data.aggregate namespace (I ran into this while using ray.data):

Before:
<img width="712" alt="Screen Shot 2023-06-15 at 1 09 45 PM" src="https://github.com/ray-project/ray/assets/113316/38313256-735b-4ae1-b8f0-78c5729683d6">


After:
<img width="498" alt="Screen Shot 2023-06-15 at 1 10 39 PM" src="https://github.com/ray-project/ray/assets/113316/01e4cc8a-36ed-466e-8b4c-83b003e9994a">
  • Loading branch information
pcmoritz committed Jun 15, 2023
1 parent 62b4834 commit 5d772c6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from ray.data._internal.planner.exchange.interfaces import ExchangeTaskSpec
from ray.data._internal.table_block import TableBlockAccessor
from ray.data.aggregate import AggregateFn, Count, _AggregateOnKeyBase
from ray.data.aggregate import AggregateFn, Count
from ray.data.aggregate._aggregate import _AggregateOnKeyBase
from ray.data.block import Block, BlockAccessor, BlockExecStats, BlockMetadata, KeyType


Expand Down
23 changes: 23 additions & 0 deletions python/ray/data/aggregate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from ray.data.aggregate._aggregate import (
AbsMax,
AggregateFn,
Count,
Max,
Mean,
Min,
Quantile,
Std,
Sum,
)

__all__ = [
"AbsMax",
"AggregateFn",
"Count",
"Max",
"Mean",
"Min",
"Quantile",
"Std",
"Sum",
]
File renamed without changes.
12 changes: 2 additions & 10 deletions python/ray/data/grouped_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@
from ray.data._internal.plan import AllToAllStage
from ray.data._internal.push_based_shuffle import PushBasedShufflePlan
from ray.data._internal.shuffle import ShuffleOp, SimpleShufflePlan
from ray.data.aggregate import (
AggregateFn,
Count,
Max,
Mean,
Min,
Std,
Sum,
_AggregateOnKeyBase,
)
from ray.data.aggregate import AggregateFn, Count, Max, Mean, Min, Std, Sum
from ray.data.aggregate._aggregate import _AggregateOnKeyBase
from ray.data.block import (
Block,
BlockAccessor,
Expand Down
3 changes: 2 additions & 1 deletion release/nightly_tests/dataset/aggregate_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from typing import Tuple

import ray
from ray.data.aggregate import _AggregateOnKeyBase, Max, Mean, Min, Sum
from ray.data.aggregate import Max, Mean, Min, Sum
from ray.data.aggregate._aggregate import _AggregateOnKeyBase
from ray.data.block import Block
from ray.data.dataset import Dataset
import pyarrow.compute as pac
Expand Down

0 comments on commit 5d772c6

Please sign in to comment.