Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data] Remove Preprocessor.transform_stats #43023

Merged
merged 3 commits into from
Feb 7, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion doc/source/data/api/preprocessor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Fit/Transform APIs
~preprocessor.Preprocessor.fit_transform
~preprocessor.Preprocessor.transform
~preprocessor.Preprocessor.transform_batch
~preprocessor.Preprocessor.transform_stats


Generic Preprocessors
Expand Down
18 changes: 2 additions & 16 deletions python/ray/data/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import pickle
import warnings
from enum import Enum
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
from typing import TYPE_CHECKING, Any, Dict, Union

from ray.air.util.data_batch_conversion import BatchFormat
from ray.util.annotations import Deprecated, DeveloperAPI, PublicAPI
from ray.util.annotations import DeveloperAPI, PublicAPI

if TYPE_CHECKING:
import numpy as np
Expand Down Expand Up @@ -85,20 +85,6 @@ def fit_status(self) -> "Preprocessor.FitStatus":
else:
return Preprocessor.FitStatus.NOT_FITTED

@Deprecated
def transform_stats(self) -> Optional[str]:
"""Return Dataset stats for the most recent transform call, if any."""

raise DeprecationWarning(
"`preprocessor.transform_stats()` is no longer supported in Ray 2.4. "
"With Dataset now lazy by default, the stats are only populated "
"after execution. Once the dataset transform is executed, the "
"stats can be accessed directly from the transformed dataset "
"(`ds.stats()`), or can be viewed in the ray-data.log "
"file saved in the Ray logs directory "
"(defaults to /tmp/ray/session_{SESSION_ID}/logs/)."
)

def fit(self, ds: "Dataset") -> "Preprocessor":
"""Fit this Preprocessor to the Dataset.

Expand Down
7 changes: 0 additions & 7 deletions python/ray/data/tests/preprocessors/test_preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,6 @@ def test_numpy_pandas_support_transform_batch_tensor(create_dummy_preprocessors)
)


def test_transform_stats_raises_deprecation_warning(create_dummy_preprocessors):
with_nothing, _, _, _, _ = create_dummy_preprocessors

with pytest.raises(DeprecationWarning):
with_nothing.transform_stats()


if __name__ == "__main__":
import sys

Expand Down