Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: zhilong <[email protected]>
  • Loading branch information
Bye-legumes committed Dec 3, 2024
1 parent 4d28c6a commit fb7f3d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/ray/data/_internal/pandas_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def get_deep_size(obj):

# TensorDtype for ray.air.util.tensor_extensions.pandas.TensorDtype
object_need_check = (TensorDtype,)
min_sample_size = _PANDAS_SIZE_BYTES_MIN_COUNT
max_sample_count = _PANDAS_SIZE_BYTES_MAX_SAMPLE_COUNT

# Handle object columns separately
for column in self._table.columns:
Expand All @@ -366,8 +366,8 @@ def get_deep_size(obj):
):
total_size = len(self._table[column])

# Determine the sample size based on min_count
sample_size = min(total_size, min_sample_size)
# Determine the sample size based on max_sample_count
sample_size = min(total_size, max_sample_count)
# Following codes can also handel case that sample_size == total_size
sampled_data = self._table[column].sample(n=sample_size).values

Expand Down

0 comments on commit fb7f3d5

Please sign in to comment.