Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ def setup_delta_sharing_connections(self, url: str):
"""
Set up delta sharing connections based on the url.

:param url: a url under the format "<profile>#<share>.<schema>.<table>"
:
Args:
url: A URL under the format "<profile>#<share>.<schema>.<table>"

Returns:
A tuple of (table, rest_client) where table is a delta_sharing Table
object and rest_client is a DataSharingRestClient instance.
"""
from delta_sharing.protocol import DeltaSharingProfile, Table
from delta_sharing.rest_client import DataSharingRestClient
Expand Down
16 changes: 10 additions & 6 deletions python/ray/data/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,9 @@ def hash(self) -> BlockColumn:
Internally, Polars is used to compute row-level hashes even when the original column
is backed by Pandas or PyArrow.

:return: A column of 64-bit integer hashes, returned in the same format as the underlying backend
(e.g., Pandas Series or PyArrow Array).
Returns:
A column of 64-bit integer hashes, returned in the same format as the
underlying backend (e.g., Pandas Series or PyArrow Array).
"""
raise NotImplementedError()

Expand All @@ -720,10 +721,13 @@ def is_composed_of_lists(self, types: Optional[Tuple] = None) -> bool:
"""
Checks whether the column is composed of list-like elements.

:param types: Optional tuple of backend-specific types to check against.
If not provided, defaults to list-like types appropriate
for the underlying backend (e.g., PyArrow list types).
:return: True if the column is made up of list-like values; False otherwise.
Args:
types: Optional tuple of backend-specific types to check against.
If not provided, defaults to list-like types appropriate
for the underlying backend (e.g., PyArrow list types).

Returns:
True if the column is made up of list-like values; False otherwise.
"""
raise NotImplementedError()

Expand Down
11 changes: 7 additions & 4 deletions python/ray/data/preprocessors/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,10 +789,13 @@ def unique_post_fn(drop_na_values: bool = False) -> Callable[[Set], Dict[str, in
Returns a post-processing function that generates an encoding map by
sorting the unique values produced during aggregation or stats computation.

:param drop_na_values: If True, NA/null values will be silently dropped from the encoding map.
If False, raises an error if any NA/null values are present.
:return: A callable that takes a set of unique values and returns a dictionary
mapping each value to a unique integer index.
Args:
drop_na_values: If True, NA/null values will be silently dropped from the
encoding map. If False, raises an error if any NA/null values are present.

Returns:
A callable that takes a set of unique values and returns a dictionary
mapping each value to a unique integer index.
"""

def gen_value_index(values: Set) -> Dict[str, int]:
Expand Down
11 changes: 6 additions & 5 deletions python/ray/data/preprocessors/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@ def add_callable_stat(
This supports legacy use cases where arbitrary callables are needed
and cannot be run via Dataset.aggregate().

:param post_key_fn:
:param stat_fn: A zero-argument callable that returns the stat.
:param post_process_fn: Function to apply to the result.
:param columns:
:param stat_key_fn:
Args:
stat_fn: A zero-argument callable that returns the stat.
post_process_fn: Function to apply to the result.
stat_key_fn:
post_key_fn:
columns:
"""
self._aggregators.append(
CallableStatSpec(
Expand Down