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

revert cleaned metadata #7

Open
wants to merge 1 commit into
base: pinterest/main-2.9.3
Choose a base branch
from
Open
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
15 changes: 2 additions & 13 deletions python/ray/data/_internal/planner/plan_read_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@
READ_FILE_MAX_ATTEMPTS = 10
READ_FILE_RETRY_MAX_BACKOFF_SECONDS = 32

import time
import logging
logger = logging.getLogger(__name__)

# Defensively compute the size of the block as the max size reported by the
# datasource and the actual read task size. This is to guard against issues
# with bad metadata reporting.
def cleaned_metadata(read_task: ReadTask):
block_meta = read_task.get_metadata()
task_size = 0
task_size = len(cloudpickle.dumps(read_task))
if block_meta.size_bytes is None or task_size > block_meta.size_bytes:
if task_size > TASK_SIZE_WARN_THRESHOLD_BYTES:
print(
Expand All @@ -60,15 +57,10 @@ def get_input_data(target_max_block_size) -> List[RefBundle]:
assert (
parallelism is not None
), "Read parallelism must be set by the optimizer before execution"
start = time.time()
read_tasks = op._datasource_or_legacy_reader.get_read_tasks(parallelism)
end = time.time()
logger.info(f"Getting read tasks took: {end-start} seconds")
_warn_on_high_parallelism(parallelism, len(read_tasks))

# Follow up on the comment below
start = time.time()
bundle = [
return [
RefBundle(
[
(
Expand All @@ -85,9 +77,6 @@ def get_input_data(target_max_block_size) -> List[RefBundle]:
)
for read_task in read_tasks
]
end = time.time()
logger.info(f"Generating reference bundle took: {end-start} seconds")
return bundle

inputs = InputDataBuffer(
input_data_factory=get_input_data,
Expand Down
Loading