Skip to content

Conversation

mbrobbel
Copy link
Member

Which issue does this PR close?

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

@github-actions github-actions bot added the arrow Changes to the arrow crate label Sep 29, 2025
@mbrobbel mbrobbel added this to the 57.0.0 milestone Sep 29, 2025
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

return;
}
let schema = &mut *schema;
let schema = unsafe { &mut *schema };
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems unfortunate to have to annotate every unsafe function call. I wonder if it is possible to mark the whole block unsafe, like the following:

unsafe { 
  // do unsafe things here
}

Copy link
Member Author

Choose a reason for hiding this comment

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

We can use large unsafe blocks, but in #8450 (review) and for example #8455 (comment) @crepererum suggests to minimize the size of the unsafe blocks to help with unsafe code reviewing.

Copy link
Contributor

@alamb alamb Sep 29, 2025

Choose a reason for hiding this comment

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

Makes sense -- let's go with the more surgical approach then 👍

["tsn", tz] => {
DataType::Timestamp(TimeUnit::Nanosecond, Some(Arc::from(*tz)))
}
["tss", tz] => DataType::Timestamp(TimeUnit::Second, Some(Arc::from(*tz))),
Copy link
Contributor

Choose a reason for hiding this comment

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

the choice of what rustfmt redoes seems somewhat arbitrary, but reasonable to me

@mbrobbel mbrobbel merged commit 883380b into apache:main Sep 29, 2025
27 checks passed
@mbrobbel mbrobbel deleted the arrow-schema-2024 branch September 29, 2025 19:44
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants