Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Dec 15, 2025

Which issue does this PR close?

Rationale for this change

while reviewing @xanderbailey's PR in #8960, I found that there are examples for arrow-csv and they are hard to find. Also each example add extra binaries and thus slows down CI and tests. For example the whitespace_handling example makes a new 2.9MB binary:

cargo run -p arrow-csv --example whitespace_handling
...
du -s -h target/debug/examples/whitespace_handling
2.9M	target/debug/examples/whitespace_handling

Let's consolidate the examples to make them easier to find

What changes are included in this PR?

  1. Consolidate the examples
  2. Improver other csv docs

Are these changes tested?

We typically require tests for all PRs in order to:

  1. Prevent the code from being accidentally broken by subsequent changes
  2. Serve as another way to document the expected behavior of the code

Are there any user-facing changes?

Docs only, no functional changes

@alamb alamb added the documentation Improvements or additions to documentation label Dec 15, 2025
@github-actions github-actions bot added the arrow Changes to the arrow crate label Dec 15, 2025
//! let batch = csv.next().unwrap().unwrap();
//! ```
//!
//! # Example: Numeric calculations on CSV
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Contents of arrow-csv/examples/csv_calculation.rs

//! - `DataType::Utf8View`
//!
//! ## Example with whitespace handling
//! ## Example: Use [`WriterBuilder`] to control whitespace handling
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This already has the contents of arrow-csv/examples/whitespace_handling.rs, so let's not duplicate it again

type Bounds = Option<(usize, usize)>;

/// CSV file reader using [`std::io::BufReader`]
///
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a few more doc links to make it easier to navigate between the different classes

@xanderbailey
Copy link
Contributor

Thanks for doing this!

Copy link
Contributor

@mhilton mhilton left a comment

Choose a reason for hiding this comment

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

LGTM

@alamb
Copy link
Contributor Author

alamb commented Dec 19, 2025

Thank you for the review @mhilton

@alamb alamb merged commit 240cbf4 into apache:main Dec 19, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants