Skip to content

from_arrow gets session arg#7791

Open
palaska wants to merge 7 commits intodevelopfrom
bp/arrow-with-sesh
Open

from_arrow gets session arg#7791
palaska wants to merge 7 commits intodevelopfrom
bp/arrow-with-sesh

Conversation

@palaska
Copy link
Copy Markdown
Contributor

@palaska palaska commented May 5, 2026

Summary

This PR is a mechanical refactor that deprecates from_arrow in favor of from_arrow_in, that accepts a Vortex session argument. This will be needed for arrow roundtrip with customized sessions with extension types.

This is a prerequisite for #7726

API Changes

from_arrow is deprecated. from_arrow_in should be used and it requires VortexSession to be passed.

Signed-off-by: Baris Palaska <barispalaska@gmail.com>
@palaska palaska requested a review from joseph-isaacs May 5, 2026 11:22
@palaska palaska added the changelog/break A breaking API change label May 5, 2026
@joseph-isaacs
Copy link
Copy Markdown
Contributor

Should we deprecate the old API and add this new one or just break it?

Comment thread vortex-array/src/arrow/mod.rs
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 5, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 1206 untouched benchmarks


Comparing bp/arrow-with-sesh (f7720bf) with develop (afea5e8)

Open in CodSpeed

@palaska
Copy link
Copy Markdown
Contributor Author

palaska commented May 5, 2026

Should we deprecate the old API and add this new one or just break it?

Breaking doesn't sound too bad to me, wdyt?

palaska added 4 commits May 5, 2026 13:54
Signed-off-by: Baris Palaska <barispalaska@gmail.com>
Signed-off-by: Baris Palaska <barispalaska@gmail.com>
@palaska palaska added changelog/deprecation A change that introduces a series of API deprecations and removed changelog/break A breaking API change labels May 5, 2026
Signed-off-by: Baris Palaska <barispalaska@gmail.com>
Comment on lines +28 to +40
pub trait FromArrowArray<A>: Sized {
/// Convert an Arrow array to a Vortex array, looking up extension types in `session`.
fn from_arrow_with_session(
array: A,
nullable: bool,
session: &VortexSession,
) -> VortexResult<Self>;

/// Convert an Arrow array to a Vortex array using the legacy global session.
#[deprecated(note = "Use `from_arrow_with_session` instead")]
fn from_arrow(array: A, nullable: bool) -> VortexResult<Self> {
Self::from_arrow_with_session(array, nullable, &LEGACY_SESSION)
}
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.

So the plan is the release this and then later rename from_arrow_with_session -> from_arrow (with session) once after removing the deprecated from_arrow (no session)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think so, or we can find a better name (maybe from_arrow_in?) and just delete the old function?

Signed-off-by: Baris Palaska <barispalaska@gmail.com>
@palaska palaska requested a review from joseph-isaacs May 6, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/deprecation A change that introduces a series of API deprecations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants