Repository navigation
[doc] Style pass on the Ray Data loading page - #66419
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Ray Data documentation and related docstrings to improve clarity, grammar, and consistency, including fixing a broken cross-reference link and adding section anchors. The review feedback suggests two valuable improvements: explicitly mentioning Hugging Face in the introductory sentence for ML library integrations, and correcting the Sphinx role for from_tf from {class} to {func} to ensure proper rendering.
dstrodtman
left a comment
There was a problem hiding this comment.
Meaning-diff review of this style pass: a check of whether any edit changed what the text asserts, not just how it reads.
- 51 of 72 changed blocks are cosmetic, such as heading renames with their old-slug labels, casing, "such as" for "like", and link-text updates. They're safe to skim.
- 19 of the remaining 21 kept their meaning. A reviewer checked each against the pre-edit text and, where a claim touched behavior, the Ray source.
- 1 drifted and is fixed in 8767404. L44 had turned "you can take advantage of column pruning" into the unconditional "use column pruning". Pruning helps only when you read a subset of columns, so the line now says "you can use column pruning".
- 1 changed a claim on purpose. The BigQuery sentence at L1071 is a factual correction, and the inline comment has the evidence.
The second inline comment is a question about a paragraph that was confusing before this PR.
This review was made with AI assistance (Claude Code).
| ``` | ||
|
|
||
| To read data from BigQuery, call {func}`~ray.data.read_bigquery` and specify the project id, dataset, and query (if applicable). | ||
| To read data from BigQuery, call {func}`~ray.data.read_bigquery` and specify the project ID and either a dataset or a query. |
There was a problem hiding this comment.
Factual correction, not just style. Please confirm. The old text said to specify "the project id, dataset, and query (if applicable)", which reads as if you can pass both. The new text says "the project ID and either a dataset or a query". The source backs this:
read_bigquery's docstring (python/ray/data/read_api.py) says "queryanddatasetare mutually exclusive."BigQueryDatasource.__init__(python/ray/data/_internal/datasource/bigquery_datasource.py) raisesValueErrorwhen both are provided.- With no
query, the datasource validates and splitsdataset, so one of them is required.
The page's own example comments ("Do not specify query." and "Do not specify dataset.") say the same.
| ``` | ||
|
|
||
| Set your Hugging Face token to authenticate. While public datasets can be read without a token, Hugging Face rate limits are more aggressive without a token. To read Hugging Face datasets without a token, simply set the filesystem argument to `HfFileSystem()`. | ||
| Set your Hugging Face token to authenticate. You can read public datasets without a token, but Hugging Face rate limits are more aggressive without one. To read Hugging Face datasets without a token, set the filesystem argument to `HfFileSystem()`. |
There was a problem hiding this comment.
Question (predates this PR): this paragraph tells you to set a Hugging Face token, then says to read without a token by setting the filesystem to HfFileSystem(). The example below passes token=os.environ["HF_TOKEN"]. A reader could come away unsure whether the token is required. Should the paragraph lead with the recommended path, which is to use a token to avoid stricter rate limits, and present HfFileSystem() without a token as the fallback for public datasets?
bfece38 to
34bf32e
Compare
34bf32e to
4c96cd7
Compare
4c96cd7 to
8953512
Compare
8953512 to
10398e3
Compare
e13b19a to
ce8ea2e
Compare
ce8ea2e to
a14a97e
Compare
ronny-anyscale
left a comment
There was a problem hiding this comment.
you're grammer is well
…ervability pages to MyST (#66461) ## Why are these changes needed? Converts the last non-API-reference RST pages under `ray-core/`, `data/`, and `rllib/` to MyST Markdown, plus the `train/` and `ray-observability/` pages that `doc/BUILD.bazel` names by path. The API reference trees (`*/api/`, `rllib/package_ref/`, and `ray-core/compiled-graph/compiled-graph-api`) stay RST for now. Each page gets its own commit, so you can review one file at a time. Every commit renames the page's literal `.rst` paths in `doc/BUILD.bazel` to `.md`. These paths are in `exclude` lists and in the explicit `files` lists of `doctest[data-gpu]` and `doctest[train-gpu]`, and they don't glob. Without the edit, an excluded page would silently join its target once it's `.md`, and an included page would silently drop out of it. Conversions are format-only: labels, headings, and prose are unchanged. A final whitespace-only commit soft-wraps the prose. `ray-soft-wrap`'s `verify.py` confirms non-whitespace bytes, rendered HTML, and idempotence for all 11 files. ### `rllib/getting-started`: doctest target removed The first commit deletes `doctest[rllib2]`, the only target over `rllib/getting-started.rst`, before the page converts. The target is tagged `manual` with a hang TODO, so no premerge or postmerge step has run it, and nothing else references it (`git grep rllib2` is empty). Its 15 `testcode` blocks had no `testoutput`, so they asserted nothing. The 12 visible blocks become display-only `python` code blocks. The three `:hide:` blocks held `.stop()` cleanups that never rendered, so they're deleted. `doctest[rllib]` still excludes the page. If these examples should be validated later, a `doc_code/` script is the better route than reviving the hanging target. cc @elliot-barn, who owns the TODO. This commit isn't buildable on its own. It turns a `.. testcode::` that had no blank line before its body into a `.. code-block:: python`, still with no blank line, and docutils reads the body as extra arguments to the directive. The later conversion commit fixes it in the `.md`, and a squash merge never puts the intermediate commit on master. ### Doctest coverage Docs-only PRs don't run doctests premerge. This PR edits `doc/BUILD.bazel`, so every library's docs example step runs, but premerge can't show the conversion kept the same blocks. For that, I parsed each `.md` and the `.rst` it replaced with Ray's `pytest-sphinx` fork, the same parser the doctest macro runs, and asserted identical sections (directive, body, `:options:`, `:skipif:`) and examples. | Page | BUILD role | Examples before → after | | --- | --- | --- | | `ray-core/handling-dependencies` | `doctest[core]` exclude | 17 → 17 | | `ray-core/tasks/nested-tasks` | `doctest[core]` exclude | 0 → 0 (`literalinclude` of a tested `doc_code/` file) | | `data/batch-inference` | `doctest_each` exclude, `doctest[data-gpu]` files | 7 → 7 | | `data/transforming-data` | `doctest_each` exclude, `doctest[data-gpu]` files | 24 → 24 | | `data/contributing/contributing` | `doctest_each` glob | 0 → 0 (toctree only) | | `rllib/getting-started` | `doctest[rllib]` exclude, `doctest[rllib2]` removed | 15 → 0, by the removal commit | | `ray-observability/user-guides/cli-sdk` | top-level exclude | 16 → 16 | | `ray-observability/user-guides/ray-tracing` | top-level exclude | 3 → 3 | | `train/horovod` | `doctest[train]` exclude | 2 → 2 | | `train/user-guides/data-loading-preprocessing` | `doctest[train]` exclude, `doctest[train-gpu]` files | 6 → 6 | | `train/user-guides/using-accelerators` | `doctest[train]` exclude, `doctest[train-gpu]` files | 10 → 10 | To show the check would catch a broken conversion, I mutated each page with examples three ways: dropping a `testcode` block, altering a line in one, and turning one into a four-backtick fence. The last renders fine but is never collected. The check failed on all 24 mutations. ### Rendering changes I ran `render_diff.py` on all 11 pages against `/en/master`. Six render identically: `nested-tasks`, `data/contributing/contributing`, `cli-sdk`, `ray-tracing`, `horovod`, and `using-accelerators`. Every difference on the other five is listed here. - `rllib/getting-started`: on master, one `.. testcode::` line had no blank line after it. docutils read the block's first six lines, the `best_result = results.get_best_result(...)` call, as the directive's argument and dropped them. So master shows code that uses `best_result` without showing where it comes from. The converted page renders all six lines. This is the one place the conversion deliberately doesn't reproduce master. - `rllib/getting-started`: the "Farama gymnasium" link now has `https://`. On master it's a relative link to `gymnasium.farama.org` that 404s. - `ray-core/handling-dependencies`: MyST drops the apostrophe when it slugifies the "can't import the packages" heading, so the section id changes. That heading had no label, so the page adds a target carrying the old docutils slug, and existing `#...-can-t-import-...` links still resolve. An auto-numbered span id, which nothing links to, also changes from `id4` to `id2`. - `data/batch-inference` and `train/user-guides/data-loading-preprocessing`: each renders an RST comment as an HTML comment, which readers never see. - `data/transforming-data`: the "When using" definition list's `<dl>` gains the unstyled `myst` class. The first preview diff also caught three regressions that the green build didn't. MyST's `replacements` extension turned two `(c)` list markers into `©` and an `etc..` into `etc…`. The anchor above had changed too. A follow-up commit fixes all three. A sweep of the 11 pages found no other text that extension rewrites. ### Dead `doc/BUILD.bazel` excludes A final commit drops four `exclude` entries that name files that have moved: two in `doctest[serve]` and two in the serve `doc_code` test. A glob exclude naming a missing file excludes nothing, so these had silently stopped applying. This doesn't change what any target runs. #66462 carries the same commit, along with a lint check that fails on this class of stale path, so the two PRs merge cleanly in either order. ### Open PRs that edit these files Each of these open PRs edits one of the converted `.rst` files, so each will need to move its change to the `.md`: #66279, #66191, #65956, #65933, and #65830 (`handling-dependencies`), #65693 (`cli-sdk`), and #66419, #66420, #66422, and #66423 (`data/batch-inference`, `train/user-guides/data-loading-preprocessing`). #66096, #64053, and #63881 also edit `doc/BUILD.bazel`, and only #66096 edits nearby lines. ## Related issue number None. No open PR converts these pages. I checked `gh pr list` for open PRs touching each file. ## Checks - [x] I've signed off every commit (`git commit -s`). - [x] Pre-commit hooks passed on every commit. - Doctest parity: `python3 doctest_parity.py <the 11 .md files>` with `pytest==7.4.4` and `pytest-sphinx @ git+https://github.com/ray-project/pytest-sphinx`. All OK, run again after the soft-wrap commit. - Static checks on every `.md`: fences balance, no leftover RST roles or directives, every label from the `.rst` is present, and directive counts match. - Read the Docs preview builds green under `fail_on_warning`, and the render diff against `/en/master` is in Rendering changes. The first build hit the known autosummary-import segfault and passed on rebuild. - Local doctest run: not done. The GPU targets need hardware, and the CPU targets run in this PR's premerge because of the `BUILD.bazel` change. AI assistance (Claude Code) was used for the conversion and the verification scripts. 🤖 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]>
Apply Ray's writing-style guide to doc/source/data/loading-data.md: use imperative task headings with a label for each old heading slug so existing URL fragments keep resolving, "such as" for examples, second person and active voice, and vendor spellings for Hugging Face, pandas, and Parquet. Put quoted column names in inline code, cut filler, add code-block lead-ins, and fix "underly" to "underlie". Update link text on other pages and in read_api.py docstrings that quotes the old headings, and point the "Saving data" link in working-with-images.md at the saving page instead of the loading page. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
The style pass changed "you can take advantage of column pruning" to the unconditional "use column pruning". Pruning helps only when you read a subset of columns, so restore the permissive "you can". Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Name Hugging Face in the ML-libraries lead-in, which introduces a Hugging
Face tab, and use the {func} role for from_tf, which is a function.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
Add the missing comma after the password argument. The example is skipped in tests, so the syntax error only reached readers. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
…ng guide read_mongo declares pipeline as Optional with a None default, and its docstring says Ray Data reads the entire collection without one. It has been optional since at least Ray 2.5. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
The docstring link-text updates need Ray Data code-owner review. They move to their own PR at the top of this stack so the docs-only pages can land on docs review alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
bf817fd to
bec4283
Compare
## Description Style and grammar pass on seven Ray Data operation guides against Ray's [writing-style guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html): `saving-data.md`, `inspecting-data.md`, `iterating-over-data.md`, `aggregating-data.md`, `joining-data.md`, `mixing-data.md`, and `shuffling-data.md`. Prose only, apart from one code fix: `import os` in the partitioned-write example, which used `os` without importing it. No other code, testcode, code comments, or URLs changed. Stacked on #66419. Review and merge that stack first. This branch targets `doc-1524-data-style-loading`. It's the third of several PRs that apply the same pass to the top-level Ray Data pages. ### All seven pages - Rewords task headings as imperatives, such as "Write data to files" and "Configure joins", and conceptual headings as questions, such as "How does per-block mixing work?". The gerund H1s stay, sentence-cased, to match the nav titles and the loading page. Each reworded heading gets an explicit label named after its old slug, such as `(writing-data-to-files)=`, so existing URL fragments keep resolving. Headings that already had a label keep it, with the new label stacked beneath. None of the new labels collide with existing ones. - Uses second person, active voice, present tense, and "such as" for examples. Recasts "lets", "allows", and "enables". - Removes dashes, parentheticals, semicolons, and filler such as "essentially", "actually", and "note that". - Fixes list structure and punctuation. Non-sequential numbered lists become bullets or prose, and ordered lists use `1.`. - Keeps contractions in warnings, because Vale's `Google.Contractions` rule errors on the expanded forms. ### Page-specific changes - `saving-data.md`: Folds the opening heading preview into prose and adds a lead-in under the stacked H2. Fixes a Mars tab that said "convert a Dataset from a Mars DataFrame" for `Dataset.to_mars()`. - `inspecting-data.md`: Adds the missing `{meth}` role on `Dataset.take_batch()`, which rendered its angle brackets literally. Sentence-cases the `PyArrow` tab title. - `iterating-over-data.md`: Adds the missing `{meth}` role on three method list items (`iter_batches`, `iter_torch_batches`, and `to_tf`) that had the same problem. - `aggregating-data.md`: Replaces the marketing-style opening with a statement of what the page covers. - `joining-data.md`: Replaces three bold pseudo-headings over one-item lists with one join-types list. - `mixing-data.md`: Changes the optional repartitioning advice from a `note` to a `tip`, and makes the Limitations labels parallel. - `shuffling-data.md`: Fixes the "read function function" typo, adds alt text to the push-based shuffle chart from the sentence that introduces it, and changes "(New in 2.46)" into a sentence. ### Other files - Updates link text that quotes the old headings in `inspecting-data.md`, `iterating-over-data.md`, `shuffling-data.md`, and `train/user-guides/data-loading-preprocessing.rst`. The matching `dataset.py` docstring edits are in #66604. ## Questions for reviewers These points need a Ray Data maintainer. Each one predates this PR unless noted. - **Push-based shuffle (`shuffling-data.md`):** the note says `DataContext.use_push_based_shuffle` and `RAY_DATA_PUSH_BASED_SHUFFLE` are deprecated in favor of `DataContext.shuffle_strategy`, but the same section still tells you to set both, and its examples use them. Should the section move to `ShuffleStrategy`? - **Shuffle order (`shuffling-data.md`):** the intro says the methods appear "in increasing order of resource consumption and runtime", but the page's own benchmark shows `map_batches` shuffle, which comes second, keeping more throughput than local buffer shuffle. - **Hash shuffle naming (`shuffling-data.md`):** the key-based repartitioning item says it triggers a "hash-shuffle" operation, while the tip says it uses shuffle v2 by default and calls hash-shuffle the previous implementation. - **Aggregator count (`joining-data.md`):** "Setting `max_hash_shuffle_aggregators >= num_partitions` allocates one partition per aggregator." The page also says the count defaults to the smallest of `num_partitions`, the CPU count, and the cap, so on a cluster with fewer CPUs than partitions, raising the cap alone might not be enough. - **Deprecated parameter (`joining-data.md`):** the lead-in "Tune join performance ... with the following two parameters" includes `partition_size_hint`, which the page says Ray Data ignores. - **Random mixing (`mixing-data.md`):** the random-mixing section says local batches are "each drawn from a single dataset", but an earlier note says a local batch might contain data from more than one input dataset. - **Stats log (`inspecting-data.md`):** the page says Ray Data persists execution statistics to `ray-data.log`. The streaming executor logs the stats summary only when `DataContext.enable_auto_log_stats` is set, and `DEFAULT_AUTO_LOG_STATS` is `False` in `context.py`. Should the sentence name that condition? - **Custom aggregators (`aggregating-data.md`):** the page says `AggregateFnV2` has "three key methods that you implement", including `finalize`. In `aggregate.py`, only `combine` and `aggregate_block` are abstract. `finalize` has a default, and the class docstring calls finalization optional. - **Head node (`saving-data.md`):** "Your data must fit in memory on the head node" for `to_pandas()` might mean the driver's node. - **Removal date (`saving-data.md`):** "Support for this combination ends after February 2027." Please confirm the date. - **Code the pass didn't touch:** - The GCS and Azure examples in `saving-data.md` call `gcsfs` and `adlfs` without importing them. - The NumPy example in `inspecting-data.md` prints `"Image shape"` without the colon its output shows. - `shuffling-data.md` has a `bash` block with `$` prompts and a plain `python` block in the fallback tip. - `aggregating-data.md` and `iterating-over-data.md` use `{class}` on methods (`max`, `min`, `sum`, and `random_shuffle`). - The benchmark link in the `aggregating-data.md` note ends its fragment with a slash, `#performance-benchmarks/`. ## Verification - A meaning-diff review compared every before-and-after pair. A conservative filter cleared 22 blocks as cosmetic, and reviewers found that 146 of the remaining 149 kept their meaning. The Mars tab change is the intended correction noted above. Two drifts are fixed in a follow-up commit: the mixing page's skewed-weights limitation had lost its signal that the limitation is temporary, and the joins page had lost "previous" for the hash-shuffle implementation. - `vale` with Vale 3.12, run from the repo root: no warning- or error-level alerts on the seven pages. - `codespell`: no hits. - The pre-commit hooks passed. - A structural check against each pre-edit file confirmed the code-fence count and URLs are unchanged. The only role-target changes are the four added `{meth}` roles, and every target exists on `ray.data.Dataset`. The only anchor changes are the added old-slug labels. None were removed. - Before adding each label, I grepped `doc/source` for the label name in hyphen and underscore forms. None collide. ## AI assistance I made these edits with AI assistance (Claude Code). 🤖 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]>
) ## 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]>
#66615) ## Why are these changes needed? The Ray Data style-pass PRs (#66413, #66418, #66419, #66420, #66422, #66423) left a set of mechanical and structural items open. This PR clears them. None of the edits changes a technical claim, so it needs a style review rather than an SME review. **Markup and links** - `key-concepts.md`: tags the two logical-plan output blocks as `text`, and adds alt text to the three diagrams. - `index.md`, `shuffling-data.md`: removes `$` prompts from shell blocks. - `aggregating-data.md`, `iterating-over-data.md`: uses `{meth}` instead of `{class}` for `Dataset.max`, `min`, `sum`, and `random_shuffle`. - `aggregating-data.md`: drops the trailing slash from the blog link fragment `#performance-benchmarks/`. - `train/getting-started-lightgbm.rst`, `train/getting-started-xgboost.rst`, and two Lightning example notebooks: replaces the hard-coded "Ray Data Quickstart" link text with a bare reference, so the link renders the page title. - `loading-data.md`: moves the `(reading_kafka)=` label above the Kafka heading, stacked with `(reading-from-kafka)=`. **Structure and wording** - `quickstart.md`: replaces the opening bullet list, which restated the section headings, with one sentence that keeps the section links. - `custom-datasource-example.md`: renames the two "Implement the constructor" headings to "Implement the datasource constructor" and "Implement the datasink constructor". Nothing links to the old anchors. - `loading-data.md`: moves the Iceberg tab from the distributed DataFrame libraries tab set to the "Read files" tab set, since Iceberg is a data format rather than a DataFrame library. The tab content is unchanged. - `loading-data.md`: drops the unsourced "most popular PostgreSQL database connector" claim. - `loading-data.md`: the Hugging Face paragraph now leads with the token, which the example uses, and presents `HfFileSystem()` without a token as the fallback for public datasets. See the [#66419 review thread](#66419 (comment)). - `working-with-llms.md`: moves the usage-data note out from under the NIXL troubleshooting heading into its own closing section. - `working-with-pytorch.md`: drops the `torchaudio` mention, since the section has no `torchaudio` example. - `index.md`: "what Datasets are" becomes "what a `Dataset` is", matching the class that the linked key-concepts page defines. **For reviewers** - Please confirm the diagram alt text in `key-concepts.md`. I wrote it from what each diagram shows. - #66192 adds a REST-catalog example inside the Iceberg tab that this PR moves. Whichever PR merges second needs a small rebase: the added content moves with the tab, and its `:::` fences become `::::`. ## Related issue number None. This isn't a duplicate: the items come from reviewing the merged style-pass PRs above, and I searched open PRs touching `doc/source/data/` for overlap. The only overlap is #66192, noted above. ## Checks - [x] I've signed off every commit (DCO). - [x] `pre-commit run --files <changed files>` passes. No hook covers `doc/source` Markdown or notebooks, so every content hook skipped. - [x] Checked that both edited notebooks still parse as JSON. - [ ] Sphinx build: not run locally. Relying on the Read the Docs preview for directive nesting and cross-reference resolution. AI assistance (Claude Code) was used to make these 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]>
…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]>
## Why are these changes needed? A style pass over the Ray Data guides ([#66418](#66418), [#66419](#66419), [#66420](#66420), [#66422](#66422), [#66461](#66461)) turned up code examples that are broken as written. They raise if you copy them, or they don't match what the surrounding text says. This PR fixes only those examples. It doesn't convert untested blocks to tests. | Page | Problem | Fix | |---|---|---| | `loading-data.md` | GCS example uses `gcsfs` without importing it. | Import it. | | `loading-data.md` | Azure example passes `filesystem` positionally, but it's keyword-only in `read_parquet` (`TypeError`). | Pass it by keyword. | | `loading-data.md` | BigQuery `dataset="bigquery-public-data.ml_datasets.iris"`. `BigQueryDatasource` reads `dataset` as `dataset_id.table_id` under `project_id`, so this resolves to dataset `bigquery-public-data`, table `ml_datasets`. | Use a `my_dataset.my_table` placeholder, and say the format in the comment. | | `loading-data.md` | `write_mongo` example passes an undefined `MongoDatasource()`, and `write_mongo` has no such parameter. | Remove it. | | `saving-data.md` | GCS and Azure examples use `gcsfs` and `adlfs` without importing them. | Import them. | | `inspecting-data.md` | Output shows `Image shape:`, but the print has no colon. | Add the colon to the print. | | `shuffling-data.md` | Key-based repartition on `id`, but `ds` is a `read_images` dataset with only `image`. It passed only because nothing consumed the dataset. Consumed, it raises `KeyError: Field "id" does not exist`. | Use `ray.data.range(1000)` and materialize. | | `key-concepts.md` | Streaming example uses undefined UDF names and `read_parquet(...)`, under a "1K rows" comment. | Define placeholder UDFs and use `ray.data.range(1000)`. | | `scaling-collation-functions.md` | Example reassigns `dataset` but passes `train_dataset` to the trainer. | Use `train_dataset` throughout. | | `transforming-data.md` | Polars example: imports `pl` but calls `polars.` (`NameError`). `from_pyarrow` and `DataFrame.summary` don't exist in Polars. The block never consumed `ds`, so the UDF never ran. | `pl.from_arrow`, `describe()`, and materialize. | | `transforming-data.md` | pandas `map_groups` example calls `group.drop("target")`, which drops rows by label and raises `KeyError`. | `group.pop("target")`, which sets the column aside as the code intends. Materialize. | ## Duplicate check Searched open PRs for each affected API and page (`polars from_pyarrow`, `map_groups`, `gcsfs`, `read_bigquery`, `write_mongo`, `repartition`, collation). Nothing open addresses these examples. [#66614](#66614) and [#66615](#66615) edited some of the same pages, but not these examples. Both have merged, and this branch is rebased on them. ## Testing Ran against the Ray nightly wheel (`3.0.0.dev0`, `674900c91fa`) on macOS arm64, using the same pytest arguments and Data doctest plugin as the `doctest_each` targets in `doc/BUILD.bazel`, with `pytest==7.4.4` and Ray's `pytest-sphinx` fork: ```bash python -m pytest --doctest-modules --doctest-glob='*.md' --disable-warnings -c NO_PYTEST_CONFIG \ -p doctest_pytest_plugin doc/source/data/<page>.md ``` - `loading-data.md`, `saving-data.md`, `inspecting-data.md`, `shuffling-data.md`, and `key-concepts.md` pass, before and after the change. - `transforming-data.md` is in `doctest[data-gpu]` and stops at a CUDA block on a host without a GPU, before and after. So I ran its Iris setup block and the two changed blocks as a standalone doctest file, and it passes. Before the fix, those blocks raise `NameError` and `KeyError` once the dataset is consumed. - `key-concepts.md` streaming and `scaling-collation-functions.md` are untested `python` blocks. I ran the streaming block with `num_gpus=1` removed, and it runs. The collation change is a rename, checked by reading. - The `:skipif: True` GCS, Azure, BigQuery, and MongoDB blocks need credentials, so I checked them against the current signatures in `read_api.py` and `dataset.py` and `bigquery_datasource.py`. - `pre-commit run` passes on the changed files. This change touches only `.md` files, so premerge doesn't run the Data doc example tests. ## AI assistance Claude Code helped find the source for each fix, apply the edits, and run the tests. 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]>
…ervability pages to MyST (ray-project#66461) ## Why are these changes needed? Converts the last non-API-reference RST pages under `ray-core/`, `data/`, and `rllib/` to MyST Markdown, plus the `train/` and `ray-observability/` pages that `doc/BUILD.bazel` names by path. The API reference trees (`*/api/`, `rllib/package_ref/`, and `ray-core/compiled-graph/compiled-graph-api`) stay RST for now. Each page gets its own commit, so you can review one file at a time. Every commit renames the page's literal `.rst` paths in `doc/BUILD.bazel` to `.md`. These paths are in `exclude` lists and in the explicit `files` lists of `doctest[data-gpu]` and `doctest[train-gpu]`, and they don't glob. Without the edit, an excluded page would silently join its target once it's `.md`, and an included page would silently drop out of it. Conversions are format-only: labels, headings, and prose are unchanged. A final whitespace-only commit soft-wraps the prose. `ray-soft-wrap`'s `verify.py` confirms non-whitespace bytes, rendered HTML, and idempotence for all 11 files. ### `rllib/getting-started`: doctest target removed The first commit deletes `doctest[rllib2]`, the only target over `rllib/getting-started.rst`, before the page converts. The target is tagged `manual` with a hang TODO, so no premerge or postmerge step has run it, and nothing else references it (`git grep rllib2` is empty). Its 15 `testcode` blocks had no `testoutput`, so they asserted nothing. The 12 visible blocks become display-only `python` code blocks. The three `:hide:` blocks held `.stop()` cleanups that never rendered, so they're deleted. `doctest[rllib]` still excludes the page. If these examples should be validated later, a `doc_code/` script is the better route than reviving the hanging target. cc @elliot-barn, who owns the TODO. This commit isn't buildable on its own. It turns a `.. testcode::` that had no blank line before its body into a `.. code-block:: python`, still with no blank line, and docutils reads the body as extra arguments to the directive. The later conversion commit fixes it in the `.md`, and a squash merge never puts the intermediate commit on master. ### Doctest coverage Docs-only PRs don't run doctests premerge. This PR edits `doc/BUILD.bazel`, so every library's docs example step runs, but premerge can't show the conversion kept the same blocks. For that, I parsed each `.md` and the `.rst` it replaced with Ray's `pytest-sphinx` fork, the same parser the doctest macro runs, and asserted identical sections (directive, body, `:options:`, `:skipif:`) and examples. | Page | BUILD role | Examples before → after | | --- | --- | --- | | `ray-core/handling-dependencies` | `doctest[core]` exclude | 17 → 17 | | `ray-core/tasks/nested-tasks` | `doctest[core]` exclude | 0 → 0 (`literalinclude` of a tested `doc_code/` file) | | `data/batch-inference` | `doctest_each` exclude, `doctest[data-gpu]` files | 7 → 7 | | `data/transforming-data` | `doctest_each` exclude, `doctest[data-gpu]` files | 24 → 24 | | `data/contributing/contributing` | `doctest_each` glob | 0 → 0 (toctree only) | | `rllib/getting-started` | `doctest[rllib]` exclude, `doctest[rllib2]` removed | 15 → 0, by the removal commit | | `ray-observability/user-guides/cli-sdk` | top-level exclude | 16 → 16 | | `ray-observability/user-guides/ray-tracing` | top-level exclude | 3 → 3 | | `train/horovod` | `doctest[train]` exclude | 2 → 2 | | `train/user-guides/data-loading-preprocessing` | `doctest[train]` exclude, `doctest[train-gpu]` files | 6 → 6 | | `train/user-guides/using-accelerators` | `doctest[train]` exclude, `doctest[train-gpu]` files | 10 → 10 | To show the check would catch a broken conversion, I mutated each page with examples three ways: dropping a `testcode` block, altering a line in one, and turning one into a four-backtick fence. The last renders fine but is never collected. The check failed on all 24 mutations. ### Rendering changes I ran `render_diff.py` on all 11 pages against `/en/master`. Six render identically: `nested-tasks`, `data/contributing/contributing`, `cli-sdk`, `ray-tracing`, `horovod`, and `using-accelerators`. Every difference on the other five is listed here. - `rllib/getting-started`: on master, one `.. testcode::` line had no blank line after it. docutils read the block's first six lines, the `best_result = results.get_best_result(...)` call, as the directive's argument and dropped them. So master shows code that uses `best_result` without showing where it comes from. The converted page renders all six lines. This is the one place the conversion deliberately doesn't reproduce master. - `rllib/getting-started`: the "Farama gymnasium" link now has `https://`. On master it's a relative link to `gymnasium.farama.org` that 404s. - `ray-core/handling-dependencies`: MyST drops the apostrophe when it slugifies the "can't import the packages" heading, so the section id changes. That heading had no label, so the page adds a target carrying the old docutils slug, and existing `#...-can-t-import-...` links still resolve. An auto-numbered span id, which nothing links to, also changes from `id4` to `id2`. - `data/batch-inference` and `train/user-guides/data-loading-preprocessing`: each renders an RST comment as an HTML comment, which readers never see. - `data/transforming-data`: the "When using" definition list's `<dl>` gains the unstyled `myst` class. The first preview diff also caught three regressions that the green build didn't. MyST's `replacements` extension turned two `(c)` list markers into `©` and an `etc..` into `etc…`. The anchor above had changed too. A follow-up commit fixes all three. A sweep of the 11 pages found no other text that extension rewrites. ### Dead `doc/BUILD.bazel` excludes A final commit drops four `exclude` entries that name files that have moved: two in `doctest[serve]` and two in the serve `doc_code` test. A glob exclude naming a missing file excludes nothing, so these had silently stopped applying. This doesn't change what any target runs. ray-project#66462 carries the same commit, along with a lint check that fails on this class of stale path, so the two PRs merge cleanly in either order. ### Open PRs that edit these files Each of these open PRs edits one of the converted `.rst` files, so each will need to move its change to the `.md`: ray-project#66279, ray-project#66191, ray-project#65956, ray-project#65933, and ray-project#65830 (`handling-dependencies`), ray-project#65693 (`cli-sdk`), and ray-project#66419, ray-project#66420, ray-project#66422, and ray-project#66423 (`data/batch-inference`, `train/user-guides/data-loading-preprocessing`). ray-project#66096, ray-project#64053, and ray-project#63881 also edit `doc/BUILD.bazel`, and only ray-project#66096 edits nearby lines. ## Related issue number None. No open PR converts these pages. I checked `gh pr list` for open PRs touching each file. ## Checks - [x] I've signed off every commit (`git commit -s`). - [x] Pre-commit hooks passed on every commit. - Doctest parity: `python3 doctest_parity.py <the 11 .md files>` with `pytest==7.4.4` and `pytest-sphinx @ git+https://github.com/ray-project/pytest-sphinx`. All OK, run again after the soft-wrap commit. - Static checks on every `.md`: fences balance, no leftover RST roles or directives, every label from the `.rst` is present, and directive counts match. - Read the Docs preview builds green under `fail_on_warning`, and the render diff against `/en/master` is in Rendering changes. The first build hit the known autosummary-import segfault and passed on rebuild. - Local doctest run: not done. The GPU targets need hardware, and the CPU targets run in this PR's premerge because of the `BUILD.bazel` change. AI assistance (Claude Code) was used for the conversion and the verification scripts. 🤖 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]>
## Description Style and grammar pass on `doc/source/data/loading-data.md` against Ray's [writing-style guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html). Prose only, apart from one code fix: a missing comma in the Snowflake example. No other code, testcode, code comments, or URLs changed. Stacked on ray-project#66418. Review and merge that stack first. This branch targets `doc-1524-data-style-core`. It's the second of several PRs that apply the same pass to the top-level Ray Data pages. ### `loading-data.md` - Rewords task headings as imperatives, such as "Read files" and "Load data from ML libraries", and sentence-cases the H1 and tab titles. Each reworded heading gets an explicit label named after its old slug, such as `(reading-files-from-cloud-storage)=`, so existing URL fragments keep resolving. Headings that already had a label, such as `(loading_huggingface_datasets)=`, keep it with the new one stacked beneath. The one exception is "Read from MongoDB": its existing `(reading_mongodb)=` label already generates the `#reading-mongodb` id. - Replaces the intro's bullet preview of the page's headings with one sentence that keeps all three links, and adds a lead-in under "Load data from other libraries". - Uses "such as" for examples, second person, and active voice. Recasts "lets" and "enables", and cuts filler such as "simply". - Uses the vendor spellings "Hugging Face", "pandas", "Parquet", and "Arrow". - Puts quoted column names (`item`, `id`, `data`) in inline code. - Changes "schema" to "scheme" for URI schemes, which matches the S3, GCS, and Azure tabs. - Fixes "underly" to "underlie" and adds lead-ins before code blocks. - Describes the MongoDB `pipeline` as optional. The page said you need one, but `read_mongo` declares it `Optional` with a `None` default and reads the entire collection without one. It has been optional since at least Ray 2.5. This is a factual correction. ### Other files - Updates link text that quotes the old headings in `batch-inference.rst`, `working-with-images.md`, and `train/user-guides/data-loading-preprocessing.rst`. The matching `read_api.py` docstring edits are in ray-project#66604. - Fixes a link in `working-with-images.md` whose text says "Saving data" but pointed at `loading_data`. It now points at `saving-data`. ## Questions for reviewers Apart from the BigQuery and MongoDB corrections, this pass kept the scope of every claim. These points need a Ray Data maintainer: - **BigQuery:** "project ID, dataset, and query (if applicable)" now reads "the project ID and either a dataset or a query". This is a factual correction. The `read_bigquery` docstring says the two are mutually exclusive, and `BigQueryDatasource` raises `ValueError` when both are passed. Please confirm. - **PostgreSQL:** "It's the most popular PostgreSQL database connector" has no source. - **Code the pass didn't touch:** - The GCS example uses `gcsfs.GCSFileSystem` without `import gcsfs`. - The MongoDB write example uses an undefined `MongoDatasource()`. - The Azure example passes the filesystem to `read_parquet` positionally. - The Zarr tab is a plain `python` block, not `testcode`. - **Warnings and contractions:** Ray's guide says to avoid contractions in warnings, but Vale's `Google.Contractions` rule errors on the expanded forms, so the warnings keep their contractions. The guide and the rule disagree. - **Label placement:** `(reading_kafka)=` sits after the first paragraph of the Kafka section rather than above the heading. I left it where it is. ## Verification - Follow-up commits apply fixes from automated review: the missing comma in the Snowflake example, Hugging Face in the ML-libraries lead-in, and `{func}` for `from_tf`. - A meaning-diff review compared every before-and-after pair. It cleared 51 edits as cosmetic and found that 19 of the remaining 21 kept their meaning. One drift, a permissive "you can" turned into an instruction, is fixed in a follow-up commit. The BigQuery change is the intended correction above. - `vale` with Vale 3.12, run from the repo root: no warning- or error-level alerts. Two suggestion-level alerts remain, both acronym definitions ("HDFS" and "JVM") that the style guide requires. - `codespell`: no hits. - The pre-commit hooks passed. - A structural check against the pre-edit file confirmed the code-fence count, role targets, and URLs are unchanged. The only anchor changes are the added old-slug labels. None were removed. - Before adding each label, I grepped `doc/source` for the label name in both hyphen and underscore forms. None collide. - A grep for `{ref}` and Markdown links into this page found the link text updated above and no other stale text. ## AI assistance I made these edits with AI assistance (Claude Code). 🤖 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]>
## Description Style and grammar pass on seven Ray Data operation guides against Ray's [writing-style guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html): `saving-data.md`, `inspecting-data.md`, `iterating-over-data.md`, `aggregating-data.md`, `joining-data.md`, `mixing-data.md`, and `shuffling-data.md`. Prose only, apart from one code fix: `import os` in the partitioned-write example, which used `os` without importing it. No other code, testcode, code comments, or URLs changed. Stacked on ray-project#66419. Review and merge that stack first. This branch targets `doc-1524-data-style-loading`. It's the third of several PRs that apply the same pass to the top-level Ray Data pages. ### All seven pages - Rewords task headings as imperatives, such as "Write data to files" and "Configure joins", and conceptual headings as questions, such as "How does per-block mixing work?". The gerund H1s stay, sentence-cased, to match the nav titles and the loading page. Each reworded heading gets an explicit label named after its old slug, such as `(writing-data-to-files)=`, so existing URL fragments keep resolving. Headings that already had a label keep it, with the new label stacked beneath. None of the new labels collide with existing ones. - Uses second person, active voice, present tense, and "such as" for examples. Recasts "lets", "allows", and "enables". - Removes dashes, parentheticals, semicolons, and filler such as "essentially", "actually", and "note that". - Fixes list structure and punctuation. Non-sequential numbered lists become bullets or prose, and ordered lists use `1.`. - Keeps contractions in warnings, because Vale's `Google.Contractions` rule errors on the expanded forms. ### Page-specific changes - `saving-data.md`: Folds the opening heading preview into prose and adds a lead-in under the stacked H2. Fixes a Mars tab that said "convert a Dataset from a Mars DataFrame" for `Dataset.to_mars()`. - `inspecting-data.md`: Adds the missing `{meth}` role on `Dataset.take_batch()`, which rendered its angle brackets literally. Sentence-cases the `PyArrow` tab title. - `iterating-over-data.md`: Adds the missing `{meth}` role on three method list items (`iter_batches`, `iter_torch_batches`, and `to_tf`) that had the same problem. - `aggregating-data.md`: Replaces the marketing-style opening with a statement of what the page covers. - `joining-data.md`: Replaces three bold pseudo-headings over one-item lists with one join-types list. - `mixing-data.md`: Changes the optional repartitioning advice from a `note` to a `tip`, and makes the Limitations labels parallel. - `shuffling-data.md`: Fixes the "read function function" typo, adds alt text to the push-based shuffle chart from the sentence that introduces it, and changes "(New in 2.46)" into a sentence. ### Other files - Updates link text that quotes the old headings in `inspecting-data.md`, `iterating-over-data.md`, `shuffling-data.md`, and `train/user-guides/data-loading-preprocessing.rst`. The matching `dataset.py` docstring edits are in ray-project#66604. ## Questions for reviewers These points need a Ray Data maintainer. Each one predates this PR unless noted. - **Push-based shuffle (`shuffling-data.md`):** the note says `DataContext.use_push_based_shuffle` and `RAY_DATA_PUSH_BASED_SHUFFLE` are deprecated in favor of `DataContext.shuffle_strategy`, but the same section still tells you to set both, and its examples use them. Should the section move to `ShuffleStrategy`? - **Shuffle order (`shuffling-data.md`):** the intro says the methods appear "in increasing order of resource consumption and runtime", but the page's own benchmark shows `map_batches` shuffle, which comes second, keeping more throughput than local buffer shuffle. - **Hash shuffle naming (`shuffling-data.md`):** the key-based repartitioning item says it triggers a "hash-shuffle" operation, while the tip says it uses shuffle v2 by default and calls hash-shuffle the previous implementation. - **Aggregator count (`joining-data.md`):** "Setting `max_hash_shuffle_aggregators >= num_partitions` allocates one partition per aggregator." The page also says the count defaults to the smallest of `num_partitions`, the CPU count, and the cap, so on a cluster with fewer CPUs than partitions, raising the cap alone might not be enough. - **Deprecated parameter (`joining-data.md`):** the lead-in "Tune join performance ... with the following two parameters" includes `partition_size_hint`, which the page says Ray Data ignores. - **Random mixing (`mixing-data.md`):** the random-mixing section says local batches are "each drawn from a single dataset", but an earlier note says a local batch might contain data from more than one input dataset. - **Stats log (`inspecting-data.md`):** the page says Ray Data persists execution statistics to `ray-data.log`. The streaming executor logs the stats summary only when `DataContext.enable_auto_log_stats` is set, and `DEFAULT_AUTO_LOG_STATS` is `False` in `context.py`. Should the sentence name that condition? - **Custom aggregators (`aggregating-data.md`):** the page says `AggregateFnV2` has "three key methods that you implement", including `finalize`. In `aggregate.py`, only `combine` and `aggregate_block` are abstract. `finalize` has a default, and the class docstring calls finalization optional. - **Head node (`saving-data.md`):** "Your data must fit in memory on the head node" for `to_pandas()` might mean the driver's node. - **Removal date (`saving-data.md`):** "Support for this combination ends after February 2027." Please confirm the date. - **Code the pass didn't touch:** - The GCS and Azure examples in `saving-data.md` call `gcsfs` and `adlfs` without importing them. - The NumPy example in `inspecting-data.md` prints `"Image shape"` without the colon its output shows. - `shuffling-data.md` has a `bash` block with `$` prompts and a plain `python` block in the fallback tip. - `aggregating-data.md` and `iterating-over-data.md` use `{class}` on methods (`max`, `min`, `sum`, and `random_shuffle`). - The benchmark link in the `aggregating-data.md` note ends its fragment with a slash, `#performance-benchmarks/`. ## Verification - A meaning-diff review compared every before-and-after pair. A conservative filter cleared 22 blocks as cosmetic, and reviewers found that 146 of the remaining 149 kept their meaning. The Mars tab change is the intended correction noted above. Two drifts are fixed in a follow-up commit: the mixing page's skewed-weights limitation had lost its signal that the limitation is temporary, and the joins page had lost "previous" for the hash-shuffle implementation. - `vale` with Vale 3.12, run from the repo root: no warning- or error-level alerts on the seven pages. - `codespell`: no hits. - The pre-commit hooks passed. - A structural check against each pre-edit file confirmed the code-fence count and URLs are unchanged. The only role-target changes are the four added `{meth}` roles, and every target exists on `ray.data.Dataset`. The only anchor changes are the added old-slug labels. None were removed. - Before adding each label, I grepped `doc/source` for the label name in hyphen and underscore forms. None collide. ## AI assistance I made these edits with AI assistance (Claude Code). 🤖 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]>
…-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]>
ray-project#66615) ## Why are these changes needed? The Ray Data style-pass PRs (ray-project#66413, ray-project#66418, ray-project#66419, ray-project#66420, ray-project#66422, ray-project#66423) left a set of mechanical and structural items open. This PR clears them. None of the edits changes a technical claim, so it needs a style review rather than an SME review. **Markup and links** - `key-concepts.md`: tags the two logical-plan output blocks as `text`, and adds alt text to the three diagrams. - `index.md`, `shuffling-data.md`: removes `$` prompts from shell blocks. - `aggregating-data.md`, `iterating-over-data.md`: uses `{meth}` instead of `{class}` for `Dataset.max`, `min`, `sum`, and `random_shuffle`. - `aggregating-data.md`: drops the trailing slash from the blog link fragment `#performance-benchmarks/`. - `train/getting-started-lightgbm.rst`, `train/getting-started-xgboost.rst`, and two Lightning example notebooks: replaces the hard-coded "Ray Data Quickstart" link text with a bare reference, so the link renders the page title. - `loading-data.md`: moves the `(reading_kafka)=` label above the Kafka heading, stacked with `(reading-from-kafka)=`. **Structure and wording** - `quickstart.md`: replaces the opening bullet list, which restated the section headings, with one sentence that keeps the section links. - `custom-datasource-example.md`: renames the two "Implement the constructor" headings to "Implement the datasource constructor" and "Implement the datasink constructor". Nothing links to the old anchors. - `loading-data.md`: moves the Iceberg tab from the distributed DataFrame libraries tab set to the "Read files" tab set, since Iceberg is a data format rather than a DataFrame library. The tab content is unchanged. - `loading-data.md`: drops the unsourced "most popular PostgreSQL database connector" claim. - `loading-data.md`: the Hugging Face paragraph now leads with the token, which the example uses, and presents `HfFileSystem()` without a token as the fallback for public datasets. See the [ray-project#66419 review thread](ray-project#66419 (comment)). - `working-with-llms.md`: moves the usage-data note out from under the NIXL troubleshooting heading into its own closing section. - `working-with-pytorch.md`: drops the `torchaudio` mention, since the section has no `torchaudio` example. - `index.md`: "what Datasets are" becomes "what a `Dataset` is", matching the class that the linked key-concepts page defines. **For reviewers** - Please confirm the diagram alt text in `key-concepts.md`. I wrote it from what each diagram shows. - ray-project#66192 adds a REST-catalog example inside the Iceberg tab that this PR moves. Whichever PR merges second needs a small rebase: the added content moves with the tab, and its `:::` fences become `::::`. ## Related issue number None. This isn't a duplicate: the items come from reviewing the merged style-pass PRs above, and I searched open PRs touching `doc/source/data/` for overlap. The only overlap is ray-project#66192, noted above. ## Checks - [x] I've signed off every commit (DCO). - [x] `pre-commit run --files <changed files>` passes. No hook covers `doc/source` Markdown or notebooks, so every content hook skipped. - [x] Checked that both edited notebooks still parse as JSON. - [ ] Sphinx build: not run locally. Relying on the Read the Docs preview for directive nesting and cross-reference resolution. AI assistance (Claude Code) was used to make these 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]>
…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]>
…ect#66636) ## Why are these changes needed? A style pass over the Ray Data guides ([ray-project#66418](ray-project#66418), [ray-project#66419](ray-project#66419), [ray-project#66420](ray-project#66420), [ray-project#66422](ray-project#66422), [ray-project#66461](ray-project#66461)) turned up code examples that are broken as written. They raise if you copy them, or they don't match what the surrounding text says. This PR fixes only those examples. It doesn't convert untested blocks to tests. | Page | Problem | Fix | |---|---|---| | `loading-data.md` | GCS example uses `gcsfs` without importing it. | Import it. | | `loading-data.md` | Azure example passes `filesystem` positionally, but it's keyword-only in `read_parquet` (`TypeError`). | Pass it by keyword. | | `loading-data.md` | BigQuery `dataset="bigquery-public-data.ml_datasets.iris"`. `BigQueryDatasource` reads `dataset` as `dataset_id.table_id` under `project_id`, so this resolves to dataset `bigquery-public-data`, table `ml_datasets`. | Use a `my_dataset.my_table` placeholder, and say the format in the comment. | | `loading-data.md` | `write_mongo` example passes an undefined `MongoDatasource()`, and `write_mongo` has no such parameter. | Remove it. | | `saving-data.md` | GCS and Azure examples use `gcsfs` and `adlfs` without importing them. | Import them. | | `inspecting-data.md` | Output shows `Image shape:`, but the print has no colon. | Add the colon to the print. | | `shuffling-data.md` | Key-based repartition on `id`, but `ds` is a `read_images` dataset with only `image`. It passed only because nothing consumed the dataset. Consumed, it raises `KeyError: Field "id" does not exist`. | Use `ray.data.range(1000)` and materialize. | | `key-concepts.md` | Streaming example uses undefined UDF names and `read_parquet(...)`, under a "1K rows" comment. | Define placeholder UDFs and use `ray.data.range(1000)`. | | `scaling-collation-functions.md` | Example reassigns `dataset` but passes `train_dataset` to the trainer. | Use `train_dataset` throughout. | | `transforming-data.md` | Polars example: imports `pl` but calls `polars.` (`NameError`). `from_pyarrow` and `DataFrame.summary` don't exist in Polars. The block never consumed `ds`, so the UDF never ran. | `pl.from_arrow`, `describe()`, and materialize. | | `transforming-data.md` | pandas `map_groups` example calls `group.drop("target")`, which drops rows by label and raises `KeyError`. | `group.pop("target")`, which sets the column aside as the code intends. Materialize. | ## Duplicate check Searched open PRs for each affected API and page (`polars from_pyarrow`, `map_groups`, `gcsfs`, `read_bigquery`, `write_mongo`, `repartition`, collation). Nothing open addresses these examples. [ray-project#66614](ray-project#66614) and [ray-project#66615](ray-project#66615) edited some of the same pages, but not these examples. Both have merged, and this branch is rebased on them. ## Testing Ran against the Ray nightly wheel (`3.0.0.dev0`, `674900c91fa`) on macOS arm64, using the same pytest arguments and Data doctest plugin as the `doctest_each` targets in `doc/BUILD.bazel`, with `pytest==7.4.4` and Ray's `pytest-sphinx` fork: ```bash python -m pytest --doctest-modules --doctest-glob='*.md' --disable-warnings -c NO_PYTEST_CONFIG \ -p doctest_pytest_plugin doc/source/data/<page>.md ``` - `loading-data.md`, `saving-data.md`, `inspecting-data.md`, `shuffling-data.md`, and `key-concepts.md` pass, before and after the change. - `transforming-data.md` is in `doctest[data-gpu]` and stops at a CUDA block on a host without a GPU, before and after. So I ran its Iris setup block and the two changed blocks as a standalone doctest file, and it passes. Before the fix, those blocks raise `NameError` and `KeyError` once the dataset is consumed. - `key-concepts.md` streaming and `scaling-collation-functions.md` are untested `python` blocks. I ran the streaming block with `num_gpus=1` removed, and it runs. The collation change is a rename, checked by reading. - The `:skipif: True` GCS, Azure, BigQuery, and MongoDB blocks need credentials, so I checked them against the current signatures in `read_api.py` and `dataset.py` and `bigquery_datasource.py`. - `pre-commit run` passes on the changed files. This change touches only `.md` files, so premerge doesn't run the Data doc example tests. ## AI assistance Claude Code helped find the source for each fix, apply the edits, and run the tests. 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]>
Description
Style and grammar pass on
doc/source/data/loading-data.mdagainst Ray's writing-style guide. Prose only, apart from one code fix: a missing comma in the Snowflake example. No other code, testcode, code comments, or URLs changed.Stacked on #66418. Review and merge that stack first. This branch targets
doc-1524-data-style-core. It's the second of several PRs that apply the same pass to the top-level Ray Data pages.loading-data.md(reading-files-from-cloud-storage)=, so existing URL fragments keep resolving. Headings that already had a label, such as(loading_huggingface_datasets)=, keep it with the new one stacked beneath. The one exception is "Read from MongoDB": its existing(reading_mongodb)=label already generates the#reading-mongodbid.item,id,data) in inline code.pipelineas optional. The page said you need one, butread_mongodeclares itOptionalwith aNonedefault and reads the entire collection without one. It has been optional since at least Ray 2.5. This is a factual correction.Other files
batch-inference.rst,working-with-images.md, andtrain/user-guides/data-loading-preprocessing.rst. The matchingread_api.pydocstring edits are in [doc][data] Fix Ray Data docstring link text and stale default descriptions #66604.working-with-images.mdwhose text says "Saving data" but pointed atloading_data. It now points atsaving-data.Questions for reviewers
Apart from the BigQuery and MongoDB corrections, this pass kept the scope of every claim. These points need a Ray Data maintainer:
read_bigquerydocstring says the two are mutually exclusive, andBigQueryDatasourceraisesValueErrorwhen both are passed. Please confirm.gcsfs.GCSFileSystemwithoutimport gcsfs.MongoDatasource().read_parquetpositionally.pythonblock, nottestcode.Google.Contractionsrule errors on the expanded forms, so the warnings keep their contractions. The guide and the rule disagree.(reading_kafka)=sits after the first paragraph of the Kafka section rather than above the heading. I left it where it is.Verification
{func}forfrom_tf.valewith Vale 3.12, run from the repo root: no warning- or error-level alerts. Two suggestion-level alerts remain, both acronym definitions ("HDFS" and "JVM") that the style guide requires.codespell: no hits.doc/sourcefor the label name in both hyphen and underscore forms. None collide.{ref}and Markdown links into this page found the link text updated above and no other stale text.AI assistance
I made these edits with AI assistance (Claude Code).
🤖 Generated with Claude Code