Skip to content

[Data] Restructure stdout logging - #43360

Merged
c21 merged 3 commits into
ray-project:masterfrom
c21:parallelism
Feb 26, 2024
Merged

c21 merged 3 commits into
ray-project:masterfrom
c21:parallelism

Conversation

@c21

@c21 c21 commented Feb 22, 2024 •

Copy link
Copy Markdown
Contributor

Why are these changes needed?

This PR is to restructure the standard output logging of Ray Data w/ motivation to provide useful information for users, because we heard from multiple users that the logging on standard output is spammy and not that useful.

The change includes:

  • Don't print any info/debug-level log on stdout. The warn/error-level log is still on stdout. All logs are persisted in ray-data.log file.
  • Only print out the file path of ray-data.log file and physical execution plan.
  • Enable verbose progress bar by default, because we find it's generally useful for users and developers to monitor.

The stdout after this PR:

2024-02-22 11:29:41,506	INFO streaming_executor.py:118 -- Starting execution of Dataset. Full log is in /tmp/ray/session_2024-02-22_11-29-22_201527_7239/logs/ray-data.log
2024-02-22 11:29:41,506	INFO streaming_executor.py:119 -- Execution plan of Dataset: InputDataBuffer[Input] -> TaskPoolMapOperator[ReadRange] -> TaskPoolMapOperator[Map(foo)->Map(<lambda>)]

Running: 1.0/10.0 CPU, 0.0/0.0 GPU, 0.0 MiB/512.0 MiB object_store_memory:   0%|                   | 0/10 [00:01<?, ?it/s]
- ReadRange->SplitBlocks(2): 9 active, 0 queued, 0.0 MiB objects:  15%|███                 | 3/20 [00:01<00:08,  2.11it/s]
- Map(foo)->Map(<lambda>): 10 active, 10 queued, 0.0 MiB objects:   0%|                            | 0/10 [00:01<?, ?it/s]

The stdout before this PR:

2024-02-22 11:44:25,607	INFO set_read_parallelism.py:115 -- Using autodetected parallelism=20 for stage ReadRange to satisfy parallelism at least twice the available number of CPUs (10).
2024-02-22 11:44:25,608	INFO set_read_parallelism.py:122 -- To satisfy the requested parallelism of 20, each read task output is split into 2 smaller blocks.
2024-02-22 11:44:25,608	INFO streaming_executor.py:112 -- Executing DAG InputDataBuffer[Input] -> TaskPoolMapOperator[ReadRange] -> TaskPoolMapOperator[Map(foo)->Map(<lambda>)]
2024-02-22 11:44:25,608	INFO streaming_executor.py:113 -- Execution config: ExecutionOptions(resource_limits=ExecutionResources(cpu=None, gpu=None, object_store_memory=None), exclude_resources=ExecutionResources(cpu=0, gpu=0, object_store_memory=0), locality_with_output=False, preserve_order=False, actor_locality_enabled=True, verbose_progress=False)
2024-02-22 11:44:25,608	INFO streaming_executor.py:115 -- Tip: For detailed progress reporting, run `ray.data.DataContext.get_current().execution_options.verbose_progress = True`
Running: 10.0/10.0 CPU, 0.0/0.0 GPU, 0.0 MiB/512.0 MiB object_store_memory:  45%|████▌     | 9/20 [00:02<00:01,  5.56it/s]

Related issue number

Checks

Signed-off-by: Cheng Su <[email protected]>

@bveeramani bveeramani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than manually specifying log_to_stdout=False, would it be difficult to configure the logger so that we don't print info and debug levels by default?

Comment on lines +113 to +114
"Starting execution of Dataset. Monitor progress on Ray "
"Dashboard."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the "Monitor progress on Ray Dashboard" part isn't helpful since you already receive a message when Ray initializes instructing you to view the dashboard.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wanted to emphasize that people should use dashboard for monitoring. I can also remove this, WDYT? @raulchen.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed for now.

@c21

c21 commented Feb 22, 2024

Copy link
Copy Markdown
Contributor Author

Rather than manually specifying log_to_stdout=False, would it be difficult to configure the logger so that we don't print info and debug levels by default?

We need to make sure they are still logging to log file though, and not interfere w/ warn/error-level. @scottjlee do you know if we have an easy way to do that? Thanks.

@scottjlee

Copy link
Copy Markdown
Contributor

Rather than manually specifying log_to_stdout=False, would it be difficult to configure the logger so that we don't print info and debug levels by default?

We need to make sure they are still logging to log file though, and not interfere w/ warn/error-level. @scottjlee do you know if we have an easy way to do that? Thanks.

I think the easiest way would be to save both stdout_logger and logger in _initialize_logger() as attributes of the DatasetLogger. Then we can modify the stdout_logger's info and debug methods to not do anything, so we do not log to stdout in these cases.

@c21

c21 commented Feb 26, 2024

Copy link
Copy Markdown
Contributor Author

I think the easiest way would be to save both stdout_logger and logger in _initialize_logger() as attributes of the DatasetLogger. Then we can modify the stdout_logger's info and debug methods to not do anything, so we do not log to stdout in these cases.

Got it, @scottjlee, @bveeramani - how about leaving this as a followup? Two loggers sound complicated to me, and I want us to be able to clear up logging in 2.10.


if DEBUG_TRACE_SCHEDULING:
logger.get_logger().info("Scheduling loop step...")
logger.get_logger(log_to_stdout=False).info("Scheduling loop step...")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is already behind a debug flag. can keep log_to_stdout=True for easier debugging

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, changed.

Signed-off-by: Cheng Su <[email protected]>
@c21
c21 merged commit 2bc3bd4 into ray-project:master Feb 26, 2024
@c21
c21 deleted the parallelism branch February 26, 2024 21:25
@moinnadeem

Copy link
Copy Markdown

Hey @bveeramani, @c21, heads up that I found the default of:

Enable verbose progress bar by default, because we find it's generally useful for users and developers to monitor.

Highly, highly annoying. I probably wasted 1.5 hours trying to figure out how to turn it off. There's RAY_DATA_DISABLE_PROGRESS_BARS, but also RAY_DATA_VERBOSE_PROGRESS. Why are there two environmental variables? This is a progress bar too, no?

@bveeramani

Copy link
Copy Markdown
Member

@moinnadeem sorry to hear that. That sounds super frustrating.

Why are there two environmental variables?

Looks like this is a bug. Created an Issue to track: #44267.

Highly, highly annoying.

Would you mind telling me more? Are you getting spammy behavior where the progress bar doesn't render properly, or is something else?

@moinnadeem

Copy link
Copy Markdown

Would you mind telling me more? Are you getting spammy behavior where the progress bar doesn't render properly, or is something else?

@bveeramani

The bar spams so much that looking for my print statements is like looking for a needle in a haystack. Things are fine now that I disabled it, but I think printing as much as you do isn't a sane default.

For reference, I probably have 100 Ray outputs for every output in my program! I'm on Slack if you want to chat more, we can set up a time where I can show you this (it contains some sensitive stuff, so can't post on GitHub)

@raulchen

Copy link
Copy Markdown
Contributor

@moinnadeem I fixed an issue and now the progress bars are supposed to adjust width automatically (so it won't keep printing new lines). One exceptional case is when your python script is launched by a shell script, this will be broken. Does your case happen to be the same?

@c21 c21 mentioned this pull request Mar 28, 2024
2 of 8 tasks
c21 added a commit that referenced this pull request Apr 17, 2024
This is a followup of #43360 to fix the behavior of disabling progress bar. After this PR, users only need to set `ray.data.DataContext.get_current().enable_progress_bars = False` to disable all progress bar (main + verbose bar per operator).

Tested locally and verified config is working. 

Signed-off-by: Cheng Su <[email protected]>
dstrodtman added a commit that referenced this pull request Sep 30, 2026
)

## Why are these changes needed?

The Ray Data style pass (#66413, #66418, #66419, #66420, #66422, #66423)
kept the scope of every technical claim. That round flagged statements
that disagree with the current source, or with other statements on the
same page. This PR fixes the ones the source settles. Each edit below
names the source it follows and, where one exists, the PR that caused
the drift.

Ray Data reviewers: please confirm each item. LLM owners: please check
the `working-with-llms.md` edits.

### Performance, monitoring, and configuration

- `performance-tips.md`: The default object store limit is 0.5, not 1/4.
`ResourceManager.DEFAULT_OBJECT_STORE_MEMORY_LIMIT_FRACTION` is 0.5 when
the resource allocator is on, and `op_resource_reservation_enabled`
defaults to `True`. Docs lag since #43171 (2.10).
- `performance-tips.md`: `select_columns` after `read_parquet` prunes at
read time. `ProjectionPushdown` is in `_LOGICAL_RULESET`, and
`ParquetDatasource.supports_projection_pushdown` returns true. Docs lag
since #56500 (2.50). The page now recommends the pattern its own example
uses.
- `performance-tips.md`: The "following procedure" lead-in introduced
bullets that don't describe a procedure. It now introduces them as
rules.
- `monitoring-your-workload.md`: Dropped `RAY_DATA_TRACE_SCHEDULING`,
which nothing under `python/` references anymore. It was removed in
#44399 (2.11).
- `monitoring-your-workload.md`: Dropped the
`ray.data._internal.progress_bar.ProgressBar.MAX_NAME_LENGTH` knob. The
module moved to `_internal/progress/progress_bar.py`, and the tqdm,
logging, and rich progress implementations read a separate copy in
`base_progress.py` (#59629, 2.54). The documented public setting,
`enable_progress_bar_name_truncation`, stays.
- `monitoring-your-workload.md`: The lead-in no longer says all three
settings reduce output. `use_ray_tqdm = False` changes the
implementation, not the amount of output.
- `execution-configurations.md`: Documents `retried_io_errors` in place
of `write_file_retry_on_errors`. `DataContext.__setattr__` warns that
the old option is deprecated. It was deprecated in #46685 (2.33). The
substring-then-regex matching comes from the `retried_io_errors`
docstring.
- `execution-configurations.md`: The example set `verbose_progress =
True`, which is already the default (#43360). It now sets
`preserve_order = True`.
- `how-to-avoid-ooms.md`: "Eliminates kernel OOMs" contradicted the
page's own later statement that kernel OOMs can still happen with
isolation enabled. It now uses the conditional wording of the page's
summary. For "older versions", the object store proportion warning was
removed in #62387, first released in 2.56. The node-death line no longer
cites a version.

### Shuffle, aggregation, joins, and mixing

- `internals.md`: The range-partitioning sampler takes `num_reducers *
10 / len(blocks)` samples per block (`SortTaskSpec.sample_boundaries`),
not 10. The docs were wrong from the start, #52987.
- `internals.md`: `random_shuffle` builds on `ShuffleTaskSpec`, with the
push-based scheduler under `SORT_SHUFFLE_PUSH_BASED` and the pull-based
scheduler otherwise (`planner/random_shuffle.py`). It doesn't use the
range-partitioning shuffle. The docs were wrong from the start, #65372.
- **Note:** #64875 now plans `sort()` on shuffle v2 by default. This PR
removes the stale "shuffle v2 doesn't support sort" claim from the
sentence it edits. It leaves documenting sort on shuffle v2, including
the "doesn't yet replace the range-partitioning shuffle" sentence, to
the Ray Data docs update for that change.
- `shuffling-data.md`: The push-based shuffle section now uses
`DataContext.shuffle_strategy` and `RAY_DATA_DEFAULT_SHUFFLE_STRATEGY`
instead of the deprecated `use_push_based_shuffle` and
`RAY_DATA_PUSH_BASED_SHUFFLE` (#50215, 2.43). The section also drops the
2022 log output: the "Using experimental push-based shuffle" line now
logs at debug level.
- `shuffling-data.md` and `joining-data.md`: Key-based repartitioning
and joins no longer link "hash-shuffle" to the legacy `HASH_SHUFFLE`
section. Shuffle v2 is the default for both.
- `shuffling-data.md`: Dropped "in increasing order of resource
consumption and runtime". The page's own benchmark shows `map_batches`
shuffle keeping more throughput than local buffer shuffle.
- `aggregating-data.md`: `AggregateFnV2` has two abstract methods,
`aggregate_block` and `combine`. `finalize` is optional and defaults to
returning the accumulator. The docs were wrong from the start, reworded
in #59311.
- `joining-data.md`: `_derive_max_shuffle_aggregators` caps the
aggregator count at the CPU count. One partition per aggregator also
needs at least `num_partitions` CPUs.
- `joining-data.md`: The lead-in offered `partition_size_hint` as a
tuning parameter, but the page says Ray Data ignores it.
- `mixing-data.md`: `MixOperator` interleaves whole blocks, but batches
can span blocks, as the page's note says. "Each local batch drawn from a
single dataset" now holds only when block sizes match the batch size.
- `saving-data.md`: `to_pandas()` builds the DataFrame in the calling
process by iterating batches. It doesn't build it on the head node.

### Overview, loading, and modality pages

- `key-concepts.md`: `get_execution_plan` runs the logical optimizer,
then the planner, then the physical optimizer. `FuseOperators` is a
physical rule. The paragraph no longer puts both passes "during this
translation".
- `key-concepts.md`: `Read` plans to `InputDataBuffer` plus a map
operator (`plan_read_op.py`), matching line 74 and `internals.md`. The
example also switches from `read_parquet` to `read_csv`, because
`read_parquet` goes through `ListFiles` and `ReadFiles` when
`use_datasource_v2` is on. That's the default since #64821 (2.57).
- `custom-datasource-example.md`: "Unstable internal APIs" is now
"developer APIs". `FileBasedDatasource` and `RowBasedFileDatasink` are
`@DeveloperAPI`, and `Datasource` is `@PublicAPI`.
- `loading-data.md`: `read_kafka` also accepts per-partition offsets.
`"earliest"` is valid only as a start offset and `"latest"` only as an
end offset (`kafka_datasource.py` raises otherwise).
- `working-with-llms.md`: Hosted OpenAI-compatible endpoints use
`HttpRequestProcessorConfig`, and `ServeDeploymentProcessorConfig`
addresses Ray Serve deployments. The intro was wrong from the start,
#59214.
- `working-with-llms.md`: `size` is a whole-input budget. For video,
Qwen3-VL's `smart_resize` compares `t * h * w` against it. The docs were
wrong from the start, #63593.
- `working-with-tensors.md`: `map_batches` raises `ValueError` for
`batch_size="auto"` when `num_gpus` is set (#62648).

## Duplicate check

This isn't duplicating an existing PR. I searched open `ray-project/ray`
PRs for Ray Data docs and shuffle docs work, and none edits these
statements. The one related open item is a planned Ray Data docs update
for #64875. This PR deliberately leaves that change's sort-on-shuffle-v2
content alone.

## Testing

- Ran the changed `testcode` snippets from `execution-configurations.md`
and `shuffling-data.md` against a Ray nightly wheel. `random_shuffle`
under `SORT_SHUFFLE_PUSH_BASED` returned all 1,000 rows, and
`RAY_DATA_DEFAULT_SHUFFLE_STRATEGY=sort_shuffle_push_based` resolves to
that strategy.
- `vale` on the 15 changed files shows no new findings compared to
`master`.
- `pre-commit` hooks passed on commit.
- I didn't run a local Sphinx build. The new cross-references target
existing API entries, and the Read the Docs preview covers the build.

## AI assistance

I used AI assistance (Claude Code) to trace each claim to the source and
draft the edits. I reviewed every changed line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
dstrodtman added a commit that referenced this pull request Oct 1, 2026
…ptions (#66604)

## Why are these changes needed?

This PR corrects Ray Data source text that disagrees with the renamed
docs headings or with the code it describes. It touches comments and
docstrings only.

### Link text that repeats renamed headings

The Ray Data style-pass stack renamed several headings to sentence case
and imperative form. Three docstrings in `python/ray/data/` carry
explicit `:ref:` titles that repeat the old heading text. This PR
updates them to match:

- `read_api.py`, `read_sql`: "Reading from SQL Databases" → "Read SQL
databases"
- `read_api.py`, `from_huggingface`: "Loading Hugging Face datasets" →
"Load Hugging Face datasets"
- `dataset.py`, `repartition`: "Advanced: Performance Tips and Tuning" →
"Advanced: Performance tips and tuning", and "Changing the number of
output files" → "Change the number of output files"
- `dataset.py`, `random_shuffle`: "Optimizing shuffles" → "Optimize
shuffles", and lowercases the start of an inline link that sits
mid-sentence

The labels don't change, so every reference resolves before and after
this PR. The only effect is that the rendered link text matches the
target heading.

### Source text that contradicts the code

- `context.py`, `max_hash_shuffle_aggregators`: the comment said the
default is twice the cluster CPU count. The code in `hash_shuffle.py`
uses `min(max(1, ceil(cluster CPUs)), max_hash_shuffle_aggregators or
DEFAULT_MAX_HASH_SHUFFLE_AGGREGATORS)`, and has never doubled since
#55510 added the comment and the code together. The comment now says the
CPU count, at least 1.
- `execution_options.py`, `ExecutionOptions.verbose_progress`: #43360
made the option on by default and added "On by default.", but left the
older sentence that described the off state as the default. That
sentence now describes the off state explicitly. This matches
`RAY_DATA_VERBOSE_PROGRESS` defaulting to `"1"`.

After this change the API reference agrees with the
`execution-configurations.md` and `joining-data.md` pages.

The link-text edits used to sit in #66419, #66420, and #66423. They
moved here so the docs-only PRs in the stack need only docs review.

## Related issue number

None. Follow-up to the stack starting at #66418.

## Checks

- Not a duplicate. No other open PR touches these docstrings or
comments.
- `pre-commit` passed on all four files, including ruff, black,
pydoclint, and the Ray docstyle check.
- The diff changes comment and docstring text only. No code, defaults,
or labels change.
- AI assistance (Claude Code) was used to prepare this PR. I reviewed
every changed line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…-project#66614)

## Why are these changes needed?

The Ray Data style pass (ray-project#66413, ray-project#66418, ray-project#66419, ray-project#66420, ray-project#66422, ray-project#66423)
kept the scope of every technical claim. That round flagged statements
that disagree with the current source, or with other statements on the
same page. This PR fixes the ones the source settles. Each edit below
names the source it follows and, where one exists, the PR that caused
the drift.

Ray Data reviewers: please confirm each item. LLM owners: please check
the `working-with-llms.md` edits.

### Performance, monitoring, and configuration

- `performance-tips.md`: The default object store limit is 0.5, not 1/4.
`ResourceManager.DEFAULT_OBJECT_STORE_MEMORY_LIMIT_FRACTION` is 0.5 when
the resource allocator is on, and `op_resource_reservation_enabled`
defaults to `True`. Docs lag since ray-project#43171 (2.10).
- `performance-tips.md`: `select_columns` after `read_parquet` prunes at
read time. `ProjectionPushdown` is in `_LOGICAL_RULESET`, and
`ParquetDatasource.supports_projection_pushdown` returns true. Docs lag
since ray-project#56500 (2.50). The page now recommends the pattern its own example
uses.
- `performance-tips.md`: The "following procedure" lead-in introduced
bullets that don't describe a procedure. It now introduces them as
rules.
- `monitoring-your-workload.md`: Dropped `RAY_DATA_TRACE_SCHEDULING`,
which nothing under `python/` references anymore. It was removed in
ray-project#44399 (2.11).
- `monitoring-your-workload.md`: Dropped the
`ray.data._internal.progress_bar.ProgressBar.MAX_NAME_LENGTH` knob. The
module moved to `_internal/progress/progress_bar.py`, and the tqdm,
logging, and rich progress implementations read a separate copy in
`base_progress.py` (ray-project#59629, 2.54). The documented public setting,
`enable_progress_bar_name_truncation`, stays.
- `monitoring-your-workload.md`: The lead-in no longer says all three
settings reduce output. `use_ray_tqdm = False` changes the
implementation, not the amount of output.
- `execution-configurations.md`: Documents `retried_io_errors` in place
of `write_file_retry_on_errors`. `DataContext.__setattr__` warns that
the old option is deprecated. It was deprecated in ray-project#46685 (2.33). The
substring-then-regex matching comes from the `retried_io_errors`
docstring.
- `execution-configurations.md`: The example set `verbose_progress =
True`, which is already the default (ray-project#43360). It now sets
`preserve_order = True`.
- `how-to-avoid-ooms.md`: "Eliminates kernel OOMs" contradicted the
page's own later statement that kernel OOMs can still happen with
isolation enabled. It now uses the conditional wording of the page's
summary. For "older versions", the object store proportion warning was
removed in ray-project#62387, first released in 2.56. The node-death line no longer
cites a version.

### Shuffle, aggregation, joins, and mixing

- `internals.md`: The range-partitioning sampler takes `num_reducers *
10 / len(blocks)` samples per block (`SortTaskSpec.sample_boundaries`),
not 10. The docs were wrong from the start, ray-project#52987.
- `internals.md`: `random_shuffle` builds on `ShuffleTaskSpec`, with the
push-based scheduler under `SORT_SHUFFLE_PUSH_BASED` and the pull-based
scheduler otherwise (`planner/random_shuffle.py`). It doesn't use the
range-partitioning shuffle. The docs were wrong from the start, ray-project#65372.
- **Note:** ray-project#64875 now plans `sort()` on shuffle v2 by default. This PR
removes the stale "shuffle v2 doesn't support sort" claim from the
sentence it edits. It leaves documenting sort on shuffle v2, including
the "doesn't yet replace the range-partitioning shuffle" sentence, to
the Ray Data docs update for that change.
- `shuffling-data.md`: The push-based shuffle section now uses
`DataContext.shuffle_strategy` and `RAY_DATA_DEFAULT_SHUFFLE_STRATEGY`
instead of the deprecated `use_push_based_shuffle` and
`RAY_DATA_PUSH_BASED_SHUFFLE` (ray-project#50215, 2.43). The section also drops the
2022 log output: the "Using experimental push-based shuffle" line now
logs at debug level.
- `shuffling-data.md` and `joining-data.md`: Key-based repartitioning
and joins no longer link "hash-shuffle" to the legacy `HASH_SHUFFLE`
section. Shuffle v2 is the default for both.
- `shuffling-data.md`: Dropped "in increasing order of resource
consumption and runtime". The page's own benchmark shows `map_batches`
shuffle keeping more throughput than local buffer shuffle.
- `aggregating-data.md`: `AggregateFnV2` has two abstract methods,
`aggregate_block` and `combine`. `finalize` is optional and defaults to
returning the accumulator. The docs were wrong from the start, reworded
in ray-project#59311.
- `joining-data.md`: `_derive_max_shuffle_aggregators` caps the
aggregator count at the CPU count. One partition per aggregator also
needs at least `num_partitions` CPUs.
- `joining-data.md`: The lead-in offered `partition_size_hint` as a
tuning parameter, but the page says Ray Data ignores it.
- `mixing-data.md`: `MixOperator` interleaves whole blocks, but batches
can span blocks, as the page's note says. "Each local batch drawn from a
single dataset" now holds only when block sizes match the batch size.
- `saving-data.md`: `to_pandas()` builds the DataFrame in the calling
process by iterating batches. It doesn't build it on the head node.

### Overview, loading, and modality pages

- `key-concepts.md`: `get_execution_plan` runs the logical optimizer,
then the planner, then the physical optimizer. `FuseOperators` is a
physical rule. The paragraph no longer puts both passes "during this
translation".
- `key-concepts.md`: `Read` plans to `InputDataBuffer` plus a map
operator (`plan_read_op.py`), matching line 74 and `internals.md`. The
example also switches from `read_parquet` to `read_csv`, because
`read_parquet` goes through `ListFiles` and `ReadFiles` when
`use_datasource_v2` is on. That's the default since ray-project#64821 (2.57).
- `custom-datasource-example.md`: "Unstable internal APIs" is now
"developer APIs". `FileBasedDatasource` and `RowBasedFileDatasink` are
`@DeveloperAPI`, and `Datasource` is `@PublicAPI`.
- `loading-data.md`: `read_kafka` also accepts per-partition offsets.
`"earliest"` is valid only as a start offset and `"latest"` only as an
end offset (`kafka_datasource.py` raises otherwise).
- `working-with-llms.md`: Hosted OpenAI-compatible endpoints use
`HttpRequestProcessorConfig`, and `ServeDeploymentProcessorConfig`
addresses Ray Serve deployments. The intro was wrong from the start,
ray-project#59214.
- `working-with-llms.md`: `size` is a whole-input budget. For video,
Qwen3-VL's `smart_resize` compares `t * h * w` against it. The docs were
wrong from the start, ray-project#63593.
- `working-with-tensors.md`: `map_batches` raises `ValueError` for
`batch_size="auto"` when `num_gpus` is set (ray-project#62648).

## Duplicate check

This isn't duplicating an existing PR. I searched open `ray-project/ray`
PRs for Ray Data docs and shuffle docs work, and none edits these
statements. The one related open item is a planned Ray Data docs update
for ray-project#64875. This PR deliberately leaves that change's sort-on-shuffle-v2
content alone.

## Testing

- Ran the changed `testcode` snippets from `execution-configurations.md`
and `shuffling-data.md` against a Ray nightly wheel. `random_shuffle`
under `SORT_SHUFFLE_PUSH_BASED` returned all 1,000 rows, and
`RAY_DATA_DEFAULT_SHUFFLE_STRATEGY=sort_shuffle_push_based` resolves to
that strategy.
- `vale` on the 15 changed files shows no new findings compared to
`master`.
- `pre-commit` hooks passed on commit.
- I didn't run a local Sphinx build. The new cross-references target
existing API entries, and the Read the Docs preview covers the build.

## AI assistance

I used AI assistance (Claude Code) to trace each claim to the source and
draft the edits. I reviewed every changed line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ptions (ray-project#66604)

## Why are these changes needed?

This PR corrects Ray Data source text that disagrees with the renamed
docs headings or with the code it describes. It touches comments and
docstrings only.

### Link text that repeats renamed headings

The Ray Data style-pass stack renamed several headings to sentence case
and imperative form. Three docstrings in `python/ray/data/` carry
explicit `:ref:` titles that repeat the old heading text. This PR
updates them to match:

- `read_api.py`, `read_sql`: "Reading from SQL Databases" → "Read SQL
databases"
- `read_api.py`, `from_huggingface`: "Loading Hugging Face datasets" →
"Load Hugging Face datasets"
- `dataset.py`, `repartition`: "Advanced: Performance Tips and Tuning" →
"Advanced: Performance tips and tuning", and "Changing the number of
output files" → "Change the number of output files"
- `dataset.py`, `random_shuffle`: "Optimizing shuffles" → "Optimize
shuffles", and lowercases the start of an inline link that sits
mid-sentence

The labels don't change, so every reference resolves before and after
this PR. The only effect is that the rendered link text matches the
target heading.

### Source text that contradicts the code

- `context.py`, `max_hash_shuffle_aggregators`: the comment said the
default is twice the cluster CPU count. The code in `hash_shuffle.py`
uses `min(max(1, ceil(cluster CPUs)), max_hash_shuffle_aggregators or
DEFAULT_MAX_HASH_SHUFFLE_AGGREGATORS)`, and has never doubled since
ray-project#55510 added the comment and the code together. The comment now says the
CPU count, at least 1.
- `execution_options.py`, `ExecutionOptions.verbose_progress`: ray-project#43360
made the option on by default and added "On by default.", but left the
older sentence that described the off state as the default. That
sentence now describes the off state explicitly. This matches
`RAY_DATA_VERBOSE_PROGRESS` defaulting to `"1"`.

After this change the API reference agrees with the
`execution-configurations.md` and `joining-data.md` pages.

The link-text edits used to sit in ray-project#66419, ray-project#66420, and ray-project#66423. They
moved here so the docs-only PRs in the stack need only docs review.

## Related issue number

None. Follow-up to the stack starting at ray-project#66418.

## Checks

- Not a duplicate. No other open PR touches these docstrings or
comments.
- `pre-commit` passed on all four files, including ruff, black,
pydoclint, and the Ray docstyle check.
- The diff changes comment and docstring text only. No code, defaults,
or labels change.
- AI assistance (Claude Code) was used to prepare this PR. I reviewed
every changed line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants