Skip to content

GH-38217: [R] Map format = "text" to format = "csv" in write_dataset() - #50367

Open
thisisnic wants to merge 4 commits into
apache:mainfrom
thisisnic:worktree-GH-38217-text-to-csv
Open

GH-38217: [R] Map format = "text" to format = "csv" in write_dataset()#50367
thisisnic wants to merge 4 commits into
apache:mainfrom
thisisnic:worktree-GH-38217-text-to-csv

Conversation

@thisisnic

@thisisnic thisisnic commented Jul 4, 2026

Copy link
Copy Markdown
Member

Rationale for this change

write_dataset() errors on format="text" even though open_dataset() allows it.

What changes are included in this PR?

Map "text" to "csv" so write_dataset() mirrors open_dataset()

Are these changes tested?

Yes

Are there any user-facing changes?

No

@thisisnic
thisisnic requested a review from jonkeane as a code owner July 4, 2026 22:15
Copilot AI lite review requested due to automatic review settings July 4, 2026 22:15
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

⚠️ GitHub issue #38217 has been automatically assigned in GitHub to PR creator.

Copilot AI 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.

Pull request overview

This PR aligns the R write_dataset() format handling with open_dataset() by treating format = "text" as an alias of CSV, so users can write delimited text datasets with the same expectations as when opening them.

Changes:

  • Map format = "text" to "csv" inside write_dataset() so it uses CSV defaults (notably comma delimiter) and generates .csv filenames.
  • Narrow the “delimiter required” validation to only apply to format = "txt", avoiding the previous error for format = "text".
  • Update tests to cover the new format = "text" behavior and remove the old expectation that it errors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
r/R/dataset-write.R Adds text -> csv mapping and updates delimiter validation to only enforce a delimiter for txt.
r/tests/testthat/test-dataset-write.R Replaces the previous error expectation for format="text" with a round-trip test asserting .csv output and correct data.

@thisisnic
thisisnic marked this pull request as draft July 5, 2026 13:48
@thisisnic thisisnic changed the title GH-38217: [R] Map format = "text to format = "csv" in write_dataset() GH-38217: [R] Map format = "text" to format = "csv" in write_dataset() Aug 18, 2026
@thisisnic
thisisnic force-pushed the worktree-GH-38217-text-to-csv branch from d048f45 to 4292634 Compare August 18, 2026 13:49
@thisisnic
thisisnic marked this pull request as ready for review August 18, 2026 13:49
Copilot AI review requested due to automatic review settings August 18, 2026 13:49

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

r/R/dataset-write.R:156

  • PR description says there are no user-facing changes, but this change makes write_dataset(format = "text") succeed where it previously errored (a user-visible behavior change). Consider updating the PR description/release-note wording to reflect this bugfix.
  if (format == "text") {
    format <- "csv"
  }

Copilot AI review requested due to automatic review settings August 25, 2026 10:07
@thisisnic
thisisnic force-pushed the worktree-GH-38217-text-to-csv branch from 4292634 to 85d49ac Compare August 25, 2026 10:07

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comment thread r/tests/testthat/test-dataset-write.R
Copilot AI review requested due to automatic review settings August 25, 2026 10:42
@github-actions github-actions Bot added awaiting review Awaiting review awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Aug 25, 2026

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread r/tests/testthat/test-dataset-write.R
Comment thread r/R/dataset-write.R
Copilot AI review requested due to automatic review settings September 4, 2026 10:26
@github-actions github-actions Bot added awaiting review Awaiting review and removed awaiting review Awaiting review awaiting changes Awaiting changes labels Sep 4, 2026

Copilot AI 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.

🟢 Approval recommended

The change is narrowly scoped, matches the linked issue’s acceptance criteria, and is covered by an explicit regression test.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants