Skip to content

Conversation

mbrobbel
Copy link
Member

@mbrobbel mbrobbel commented Aug 26, 2025

Which issue does this PR close?

Rationale for this change

Following https://github.com/apache/arrow-rs?tab=readme-ov-file#rust-version-compatibility-policy.

What changes are included in this PR?

Are these changes tested?

CI

Are there any user-facing changes?

Yes:

  • MSRV is now 1.85
  • Signature change of arrow::util::pretty methods

@github-actions github-actions bot added parquet Changes to the parquet crate arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate parquet-derive parquet-variant parquet-variant* crates arrow-avro arrow-avro crate labels Aug 26, 2025
@mbrobbel mbrobbel added the next-major-release the PR has API changes and it waiting on the next major version label Aug 26, 2025
@mbrobbel mbrobbel marked this pull request as ready for review August 26, 2025 11:47
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @mbrobbel

I found this easier to review with whitespace blind diff on: https://github.com/apache/arrow-rs/pull/8227/files?w=1

I reviewed the changes up until the parquet crates I think they look great and make the code easier to read and maintain but I worry about my ability to review it in detail. However, I ran out of time.

The only real concern I have is to ensure that this change remain backwards compatible with existing users / rust versions? Given the MSRV checks I think it will, but we might want to double check (maybe we can try to update DataFusion to use this PR to see)

Would it be possible to split the PR so it is easier to review? Some ideas

  1. just change rustfmt.toml file to get the formatting only changes? I tried it locally and it didn't seem to change anything
  2. Change the edition for only a few crates at a time (arrow, arrow-schema in one PR, then parquet in the next, etc)

BTW I think this PR is likely to attract many merge conflicts, so it probably makes sense to get it merged asap

/// +---+---+"#);
/// ```
pub fn pretty_format_batches(results: &[RecordBatch]) -> Result<impl Display, ArrowError> {
pub fn pretty_format_batches(results: &[RecordBatch]) -> Result<impl Display + use<>, ArrowError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the implication of this change for users of this crate? I assume it is a no-op but I am not familiar with the use syntax

Copy link
Member Author

Choose a reason for hiding this comment

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

The relevant change is documented here https://doc.rust-lang.org/edition-guide/rust-2024/rpit-lifetime-capture.html

In Rust 2021 and earlier editions, when the use<..> bound is not present, generic lifetime parameters are only captured when they appear syntactically within a bound in RPIT opaque types in the signature of bare functions and associated functions and methods within inherent impls. However, starting in Rust 2024, these in-scope generic lifetime parameters are unconditionally captured.

The returned type does not capture the lifetime of the recordbatch slice, so use<> indicates this.

For users this means that the following still compiles in 2024 Rust:

let record_batches: &[RecordBatch] = ...;
let pretty = pretty_format_batches(record_batches)?;
drop(record_batches);
dbg!(pretty);

Without use<> in 2024 Rust rustc would complain about record_batches still being borrowed when dropped.

unsafe fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
let b = flatbuffers::read_scalar_at::<i16>(buf, loc);
Self(b)
unsafe {
Copy link
Contributor

Choose a reason for hiding this comment

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

since this file is automatically generated by flatbuffers compiler, can we avoid these changes (maybe by suppressing whatever compiler lint / or hard coding this file to use the old edition?)

Copy link
Member Author

Choose a reason for hiding this comment

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

I reverted the changes and updated regen.sh to handle the gen keyword, and after regenaration it seems flatc now adds the required unsafe.

@mbrobbel
Copy link
Member Author

The only real concern I have is to ensure that this change remain backwards compatible with existing users / rust versions? Given the MSRV checks I think it will, but we might want to double check (maybe we can try to update DataFusion to use this PR to see)

The 2024 edition is supported by rustc >=1.85 so with the msrv bump it should be fine.

1. just change `rustfmt.toml` file to get the formatting only changes? I tried it locally and it didn't seem to change anything

I reverted the formatting changes. It's now using 2021 edition for rustfmt. We can update in a different PR.

2. Change the edition for only a few crates at a time (arrow, arrow-schema in one PR,  then `parquet` in the next, etc)

Let me know if you still want me to do this.

BTW I think this PR is likely to attract many merge conflicts, so it probably makes sense to get it merged asap

We have to wait until #7836.

@mbrobbel mbrobbel added this to the 57.0.0 milestone Sep 15, 2025
@alamb
Copy link
Contributor

alamb commented Sep 23, 2025

BTW I am worried about this PR causing a lot of merge conflicts, especially for my push decoder PR:

  • Implement Push Parquet Decoder #7997
    I wonder if there is some way to break it up into smaller chunks (like do we really need to adjust the rust edition as well as the msrv in one PR?)

@mbrobbel
Copy link
Member Author

mbrobbel commented Sep 23, 2025

BTW I am worried about this PR causing a lot of merge conflicts, especially for my push decoder PR:

* [Implement Push Parquet Decoder #7997](https://github.com/apache/arrow-rs/pull/7997)
  I wonder if there is some way to break it up into smaller chunks (like do we really need to adjust the rust edition as well as the msrv in one PR?)

No we don't. I'll split this up:

alamb pushed a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-pyarrow-testing` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-ord` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-pyarrow` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-pyarrow-integration-testing` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-data` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
mbrobbel added a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-select` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-array` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
mbrobbel added a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-buffer` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
mbrobbel added a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-row` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
mbrobbel added a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-string` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
mbrobbel added a commit that referenced this pull request Sep 29, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `arrow-schema` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 30, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `parquet_derive_test` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 30, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `parquet-geospatial` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 30, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `parquet-variant-json` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Sep 30, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `parquet_derive` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
alamb pushed a commit that referenced this pull request Oct 3, 2025
# Which issue does this PR close?

- Contribute to #6827

# Rationale for this change

Splitting up #8227.

# What changes are included in this PR?

Migrate `parquet-variant-compute` to Rust 2024

# Are these changes tested?

CI

# Are there any user-facing changes?

Yes
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 arrow-avro arrow-avro crate arrow-flight Changes to the arrow-flight crate next-major-release the PR has API changes and it waiting on the next major version parquet Changes to the parquet crate parquet-derive parquet-variant parquet-variant* crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants