Skip to content

[doc] Style pass on the Ray Data custom datasource page - #66416

Closed
dstrodtman wants to merge 1 commit into
doc-1524-data-vale-cleanupfrom
doc-1524-data-style-custom-datasource
Closed

dstrodtman wants to merge 1 commit into
doc-1524-data-vale-cleanupfrom
doc-1524-data-style-custom-datasource

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Description

Style and grammar pass on the Ray Data custom datasource page (doc/source/data/custom-datasource-example.md) against Ray's writing-style guide. Prose only: no code, literalinclude blocks, URLs, the (custom_datasource)= anchor, or role targets changed.

Stacked on #66412, which removed this page's <!-- vale off --> blocks so this pass could fix the future-tense prose they hid. This branch targets doc-1524-data-vale-cleanup. It's independent of #66413, the comparisons page pass on the same base.

  • Replaces the three "you'll" future-tense sentences with present tense.
  • Names Ray Data as the actor in "file types that aren't natively supported" and "Images are already supported".
  • Replaces "functionality" with "behavior", "Once you've implemented" with "After you implement", and the "(for example, "png")" parenthetical with "such as".
  • Cuts the time-relative "in the future" from the write-interface note but keeps "is under active development and might change", which is the stability warning.
  • Sentence-cases the title: "Advanced: Read and write custom file types".
  • Updates the one link in loading-data.md whose text quotes the old title.

Why this isn't a duplicate

No other open PR edits custom-datasource-example.md or doc_code/custom_datasource_example.py. I checked the open Data PRs that mention datasources, including #65760, #57239, and #55467.

Questions for reviewers

  • The page has two H3s named "Implement the constructor", one under reading and one under writing. Nothing links to them, but "Implement the datasource constructor" and "Implement the datasink constructor" would make the right-side TOC clearer. I left them as they are.

Verification

  • vale with Vale 3.12, run from the repo root, on custom-datasource-example.md: 0 alerts, down from 6. loading-data.md has no alerts on the edited line.
  • codespell: no hits.
  • The pre-commit hooks passed on commit.
  • A structural check against the pre-edit file confirmed the code-fence count, role targets, anchors, and URLs are unchanged.
  • A grep for inbound links found the {ref} in loading-data.md, updated here, and a toctree entry in user-guide.md, which doesn't depend on the title. No links use the heading's implicit slug.
  • I didn't run a local Sphinx build. The Read the Docs preview covers rendering.

AI assistance

I made these edits with AI assistance (Claude Code) and reviewed the full diff by hand.

🤖 Generated with Claude Code

Apply Ray's writing-style guide to doc/source/data/custom-datasource-example.md:
fix the future-tense prose that Vale suppressions used to hide, name Ray Data
as the actor, replace "functionality" and the parenthetical, and
sentence-case the title. Update the link text in loading-data.md that quotes
the old title.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners September 23, 2026 11:24

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request updates the documentation for custom data sources in Ray Data, focusing on improving phrasing, professional tone, and consistency in documentation references. The review comments provide actionable suggestions to further refine the text, including specific stylistic improvements and the addition of missing tildes for proper Sphinx reference rendering.

# Advanced: Read and write custom file types

This guide shows you how to extend Ray Data to read and write file types that aren't natively supported. This is an advanced guide, and you'll use unstable internal APIs.
This advanced guide shows you how to extend Ray Data to read and write file types that it doesn't support natively. The guide relies on unstable internal APIs.

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.

medium

To improve readability and maintain a formal tone, consider avoiding the contraction 'doesn't' and placing the adverb 'natively' before the verb 'support'.

Suggested change
This advanced guide shows you how to extend Ray Data to read and write file types that it doesn't support natively. The guide relies on unstable internal APIs.
This advanced guide shows you how to extend Ray Data to read and write file types that it does not natively support. The guide relies on unstable internal APIs.

This advanced guide shows you how to extend Ray Data to read and write file types that it doesn't support natively. The guide relies on unstable internal APIs.

Images are already supported with the {func}`~ray.data.read_images` and {meth}`~ray.data.Dataset.write_images` APIs, but this example shows you how to implement them for illustrative purposes.
Ray Data already supports images with the {func}`~ray.data.read_images` and {meth}`~ray.data.Dataset.write_images` APIs. This example shows you how to implement them anyway, as an illustration.

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.

medium

The word 'anyway' is informal and conversational. Removing it and streamlining the sentence improves the professional tone of the documentation.

Suggested change
Ray Data already supports images with the {func}`~ray.data.read_images` and {meth}`~ray.data.Dataset.write_images` APIs. This example shows you how to implement them anyway, as an illustration.
Ray Data already supports images with the {func}`~ray.data.read_images` and {meth}`~ray.data.Dataset.write_images` APIs. This example shows how to implement them as an illustration.

## Loading other datasources

If Ray Data can't load your data, subclass {class}`~ray.data.Datasource`. Then, construct an instance of your custom datasource and pass it to {func}`~ray.data.read_datasource`. To write results, you might also need to subclass {class}`ray.data.Datasink`. Then, create an instance of your custom datasink and pass it to {func}`~ray.data.Dataset.write_datasink`. For more details, see {ref}`Advanced: Read and Write Custom File Types <custom_datasource>`.
If Ray Data can't load your data, subclass {class}`~ray.data.Datasource`. Then, construct an instance of your custom datasource and pass it to {func}`~ray.data.read_datasource`. To write results, you might also need to subclass {class}`ray.data.Datasink`. Then, create an instance of your custom datasink and pass it to {func}`~ray.data.Dataset.write_datasink`. For more details, see {ref}`Advanced: Read and write custom file types <custom_datasource>`.

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.

medium

To maintain consistency with other class and function references in this sentence (such as {class}ray.data.Datasource), consider adding a tilde () to the Datasink` reference so it renders as 'Datasink' instead of the full path 'ray.data.Datasink'.

Suggested change
If Ray Data can't load your data, subclass {class}`~ray.data.Datasource`. Then, construct an instance of your custom datasource and pass it to {func}`~ray.data.read_datasource`. To write results, you might also need to subclass {class}`ray.data.Datasink`. Then, create an instance of your custom datasink and pass it to {func}`~ray.data.Dataset.write_datasink`. For more details, see {ref}`Advanced: Read and write custom file types <custom_datasource>`.
If Ray Data can't load your data, subclass {class}`~ray.data.Datasource`. Then, construct an instance of your custom datasource and pass it to {func}`~ray.data.read_datasource`. To write results, you might also need to subclass {class}`~ray.data.Datasink`. Then, create an instance of your custom datasink and pass it to {func}`~ray.data.Dataset.write_datasink`. For more details, see {ref}`Advanced: Read and write custom file types <custom_datasource>`.

@dstrodtman

Copy link
Copy Markdown
Contributor Author

Combined into #66413 so the Ray Data style pass lands as one PR. The commit is cherry-picked there unchanged.

@dstrodtman dstrodtman closed this Sep 23, 2026
@dstrodtman
dstrodtman deleted the doc-1524-data-style-custom-datasource branch September 23, 2026 11:28
richardliaw pushed a commit that referenced this pull request Sep 24, 2026
## Description

Style and grammar pass on Ray Data docs against Ray's [writing-style
guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html).
Prose only: no code, `literalinclude` blocks, URLs, anchors, or role
targets changed.

Stacked on #66412, which is stacked on #66381, #66375, and #66352.
Review and merge those first. This branch targets
`doc-1524-data-vale-cleanup`. It combines this PR's original
comparisons-page pass with the custom datasource pass first opened as
#66416.

### `comparisons.md`

- Renames the legacy "Datasets" product name to "Ray Data". The page
already used "Ray Data" for the same subject in the same lists.
Third-party "Torch datasets" and "TensorFlow datasets" are unchanged.
- Fixes `SageMaker` and `BentoML` casing, which #66412 left as
intentional alerts for this pass.
- Uses contractions, active voice, second person, and "such as" for
examples.
- Removes "our blog post", "3rd", "e.g.", mid-sentence colons, and
semicolons.
- Fixes the grammar of the BentoML-and-Spark sentence and subject-verb
agreement for "TensorFlow datasets".
- Sentence-cases the dropdown titles and makes them parallel.
- Adds a lead-in sentence to each comparison list and uses the
`**Term**: explanation` definition-list form from the style guide.
- Collapses runs of blank lines between dropdowns to one.

### `custom-datasource-example.md`

This is the page whose `<!-- vale off -->` blocks #66412 removed so the
future-tense prose they hid could be fixed.

- Replaces the three "you'll" future-tense sentences with present tense.
- Names Ray Data as the actor in "file types that aren't natively
supported" and "Images are already supported".
- Replaces "functionality" with "behavior", "Once you've implemented"
with "After you implement", and the "(for example, `"png"`)"
parenthetical with "such as".
- Cuts the time-relative "in the future" from the write-interface note
but keeps "is under active development and might change", which is the
stability warning.
- Corrects the block types. The page said blocks can be dictionaries of
NumPy arrays, but `Block` in `block.py` is only a PyArrow table or a
pandas DataFrame, including at the commit the page links to. NumPy
dictionaries are a batch format. This is a factual correction.
- Sentence-cases the title: "Advanced: Read and write custom file
types".
- Updates the one link in `loading-data.md` whose text quotes the old
title.

## Why this isn't a duplicate

No other open PR edits `comparisons.md`, `custom-datasource-example.md`,
or `doc_code/custom_datasource_example.py`. #55038 adds an experimental
SQL API and SQL docs but doesn't edit these pages. See the related
question below. I also checked the open Data PRs that mention
datasources, including #65760, #57239, and #55467.

## Questions for reviewers

Apart from the block-types correction, this pass kept the scope of every
claim. These existing claims might be stale, and a Ray Data maintainer
is better placed to judge them:

- **Third-party feature claims on `comparisons.md`:** Petastorm supports
only Parquet, NVTabular supports only Parquet, CSV, and Avro, TensorFlow
datasets support only file interleaving across worker shards, and Torch
datasets have no I/O layer.
- **SQL interface:** "Ray Data doesn't have a SQL interface" would go
stale if #55038 lands.
- **Comparisons with no measure:** "a streaming paradigm that's better
suited to GPU workloads" and "can't effectively handle large datasets".
The style guide's "Keep comparisons precise" section applies, but no
source for a measure is on the page.
- **Repeated comparison points:** the training-ingest dropdowns repeat
three points almost word for word. A single comparison table might read
better. That moves content, so it isn't in this PR.
- **Duplicate headings:** `custom-datasource-example.md` has two H3s
named "Implement the constructor", one under reading and one under
writing. "Implement the datasource constructor" and "Implement the
datasink constructor" would make the right-side TOC clearer. I left them
as they are.

## Verification

- `vale` with Vale 3.12, run from the repo root: 0 alerts on
`comparisons.md`, down from 24, and 0 on `custom-datasource-example.md`,
down from 6. `loading-data.md` has no alerts on the edited line.
- `codespell`: no hits.
- The pre-commit hooks passed on each commit.
- A structural check against each pre-edit file confirmed the code-fence
count, role targets, anchors, and URLs are unchanged.
- For the reworded title, a grep for inbound links found the `{ref}` in
`loading-data.md`, updated here, and a toctree entry in `user-guide.md`,
which doesn't depend on the title. No links use the heading's implicit
slug.
- I didn't run a local Sphinx build. The Read the Docs preview covers
rendering.

## AI assistance

I made these edits with AI assistance (Claude Code) and reviewed the
full diff by hand.

🤖 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
## Description

Style and grammar pass on Ray Data docs against Ray's [writing-style
guide](https://docs.ray.io/en/master/ray-contribute/writing-style.html).
Prose only: no code, `literalinclude` blocks, URLs, anchors, or role
targets changed.

Stacked on ray-project#66412, which is stacked on ray-project#66381, ray-project#66375, and ray-project#66352.
Review and merge those first. This branch targets
`doc-1524-data-vale-cleanup`. It combines this PR's original
comparisons-page pass with the custom datasource pass first opened as
ray-project#66416.

### `comparisons.md`

- Renames the legacy "Datasets" product name to "Ray Data". The page
already used "Ray Data" for the same subject in the same lists.
Third-party "Torch datasets" and "TensorFlow datasets" are unchanged.
- Fixes `SageMaker` and `BentoML` casing, which ray-project#66412 left as
intentional alerts for this pass.
- Uses contractions, active voice, second person, and "such as" for
examples.
- Removes "our blog post", "3rd", "e.g.", mid-sentence colons, and
semicolons.
- Fixes the grammar of the BentoML-and-Spark sentence and subject-verb
agreement for "TensorFlow datasets".
- Sentence-cases the dropdown titles and makes them parallel.
- Adds a lead-in sentence to each comparison list and uses the
`**Term**: explanation` definition-list form from the style guide.
- Collapses runs of blank lines between dropdowns to one.

### `custom-datasource-example.md`

This is the page whose `<!-- vale off -->` blocks ray-project#66412 removed so the
future-tense prose they hid could be fixed.

- Replaces the three "you'll" future-tense sentences with present tense.
- Names Ray Data as the actor in "file types that aren't natively
supported" and "Images are already supported".
- Replaces "functionality" with "behavior", "Once you've implemented"
with "After you implement", and the "(for example, `"png"`)"
parenthetical with "such as".
- Cuts the time-relative "in the future" from the write-interface note
but keeps "is under active development and might change", which is the
stability warning.
- Corrects the block types. The page said blocks can be dictionaries of
NumPy arrays, but `Block` in `block.py` is only a PyArrow table or a
pandas DataFrame, including at the commit the page links to. NumPy
dictionaries are a batch format. This is a factual correction.
- Sentence-cases the title: "Advanced: Read and write custom file
types".
- Updates the one link in `loading-data.md` whose text quotes the old
title.

## Why this isn't a duplicate

No other open PR edits `comparisons.md`, `custom-datasource-example.md`,
or `doc_code/custom_datasource_example.py`. ray-project#55038 adds an experimental
SQL API and SQL docs but doesn't edit these pages. See the related
question below. I also checked the open Data PRs that mention
datasources, including ray-project#65760, ray-project#57239, and ray-project#55467.

## Questions for reviewers

Apart from the block-types correction, this pass kept the scope of every
claim. These existing claims might be stale, and a Ray Data maintainer
is better placed to judge them:

- **Third-party feature claims on `comparisons.md`:** Petastorm supports
only Parquet, NVTabular supports only Parquet, CSV, and Avro, TensorFlow
datasets support only file interleaving across worker shards, and Torch
datasets have no I/O layer.
- **SQL interface:** "Ray Data doesn't have a SQL interface" would go
stale if ray-project#55038 lands.
- **Comparisons with no measure:** "a streaming paradigm that's better
suited to GPU workloads" and "can't effectively handle large datasets".
The style guide's "Keep comparisons precise" section applies, but no
source for a measure is on the page.
- **Repeated comparison points:** the training-ingest dropdowns repeat
three points almost word for word. A single comparison table might read
better. That moves content, so it isn't in this PR.
- **Duplicate headings:** `custom-datasource-example.md` has two H3s
named "Implement the constructor", one under reading and one under
writing. "Implement the datasource constructor" and "Implement the
datasink constructor" would make the right-side TOC clearer. I left them
as they are.

## Verification

- `vale` with Vale 3.12, run from the repo root: 0 alerts on
`comparisons.md`, down from 24, and 0 on `custom-datasource-example.md`,
down from 6. `loading-data.md` has no alerts on the edited line.
- `codespell`: no hits.
- The pre-commit hooks passed on each commit.
- A structural check against each pre-edit file confirmed the code-fence
count, role targets, anchors, and URLs are unchanged.
- For the reworded title, a grep for inbound links found the `{ref}` in
`loading-data.md`, updated here, and a toctree entry in `user-guide.md`,
which doesn't depend on the title. No links use the heading's implicit
slug.
- I didn't run a local Sphinx build. The Read the Docs preview covers
rendering.

## AI assistance

I made these edits with AI assistance (Claude Code) and reviewed the
full diff by hand.

🤖 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.

1 participant