Skip to content

Deprecate vortex-array public APIs that use the hidden LEGACY_SESSION#8269

Open
joseph-isaacs wants to merge 6 commits into
developfrom
claude/sweet-sagan-GoHjV
Open

Deprecate vortex-array public APIs that use the hidden LEGACY_SESSION#8269
joseph-isaacs wants to merge 6 commits into
developfrom
claude/sweet-sagan-GoHjV

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Several public vortex-array methods construct an ExecutionCtx from the hidden global LEGACY_SESSION static instead of accepting an explicit ExecutionCtx. This PR marks them #[deprecated] so downstream callers migrate to the context-threading APIs (matching the existing IntoArrowArray deprecation pattern).

Deprecated public APIs

API File Suggested replacement
BoolTyped::true_count vortex-array/src/variants.rs sum(array, ctx) with an explicit ExecutionCtx
PrimitiveTyped::value vortex-array/src/variants.rs is_valid / execute_scalar with an explicit ExecutionCtx
PrimitiveTyped::value_unchecked vortex-array/src/variants.rs execute_scalar with an explicit ExecutionCtx
from_arrow_array_with_len vortex-array/src/arrow/datum.rs thread an explicit ExecutionCtx through execute_scalar

Each carries a #[deprecated(note = …)] explaining why and what to use instead.

These public methods construct an execution context from the hidden global
`LEGACY_SESSION` static instead of taking an explicit `ExecutionCtx`. Mark
them `#[deprecated]` so callers migrate to the context-threading APIs:

- `BoolTyped::true_count`
- `PrimitiveTyped::value`
- `PrimitiveTyped::value_unchecked`
- `from_arrow_array_with_len`

Internal callers within `vortex-array` are annotated with `#[allow(deprecated)]`
(mirroring the existing `IntoArrowArray` deprecation) so the crate continues to
build cleanly while the deprecation surfaces at downstream call sites.

Signed-off-by: Claude <noreply@anthropic.com>
@joseph-isaacs joseph-isaacs added the changelog/deprecation A change that introduces a series of API deprecations label Jun 5, 2026 — with Claude
The new `#[deprecated]` on `BoolTyped::true_count` made the workspace lint job
(`check`, `clippy-all`, `clippy-default`) fail under `-D warnings` because
`datetime-parts` and `onpair` tests still call it. Annotate those test modules
with `#[allow(deprecated)]` so CI stays green; migrating them to `sum(array, ctx)`
is left for the broader follow-up that removes the hidden static.

Signed-off-by: Claude <noreply@anthropic.com>
@codspeed-hq

codspeed-hq Bot commented Jun 5, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 25.34%

⚠️ 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.

⚡ 6 improved benchmarks
✅ 1507 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 46.6 µs 31.9 µs +46.42%
Simulation bitwise_not_vortex_buffer_mut[128] 275.3 ns 216.9 ns +26.89%
Simulation chunked_varbinview_canonical_into[(1000, 10)] 198.2 µs 162 µs +22.38%
Simulation bitwise_not_vortex_buffer_mut[1024] 336.9 ns 278.6 ns +20.94%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 213.7 µs 177.4 µs +20.5%
Simulation bitwise_not_vortex_buffer_mut[2048] 400.6 ns 342.2 ns +17.05%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/sweet-sagan-GoHjV (94eae41) with develop (5e3aedb)

Open in CodSpeed

Instead of silencing the `BoolTyped::true_count` deprecation with
`#[allow(deprecated)]`, drop the deprecated call entirely in the `datetime-parts`
and `onpair` tests. Each now counts true values via `sum(array, ctx)` with an
explicit `ExecutionCtx`:

- `datetime-parts` compare/rules tests gain a small `true_count` helper that
  builds the context from `LEGACY_SESSION` (matching the surrounding tests).
- The `onpair` smoke test reuses its existing empty-`SESSION` context.

This removes the last downstream uses of the deprecated API. Verified with
`RUSTFLAGS="-D deprecated" cargo build --all-targets` and by running both crates'
tests.

Signed-off-by: Claude <noreply@anthropic.com>
@joseph-isaacs joseph-isaacs marked this pull request as ready for review June 5, 2026 16:14
@joseph-isaacs joseph-isaacs requested a review from a team June 5, 2026 16:14
@joseph-isaacs joseph-isaacs enabled auto-merge (squash) June 5, 2026 16:14

@connortsui20 connortsui20 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.

use expect deprecated and maybe add a reason for each?

Comment on lines +205 to +206
/// Count the true values in a boolean array using an explicit execution context.
fn true_count(array: &ArrayRef) -> usize {

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.

this is a test-only function, but it doesn't do what the comment says it does

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 don't see the problem with this test the ctx is explicit to this test module not hidden in the true count

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.

Agreed — done in f8e0ae8. true_count now takes ctx: &mut ExecutionCtx, and each test constructs the context explicitly (LEGACY_SESSION.create_execution_ctx()) before calling it, so the ctx is visible in the test rather than hidden in the helper. Also updated the doc comment to say "the provided execution context".


Generated by Claude Code

}

/// Count the true values in a boolean array using an explicit execution context.
fn true_count(array: &ArrayRef) -> usize {

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.

same as below

/// The provided array must have length
#[deprecated(
note = "Relies on the hidden global `LEGACY_SESSION`; thread an explicit `ExecutionCtx` through `execute_scalar` instead"
)]

@AdamGS AdamGS Jun 8, 2026

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.

I think the note is wrong here?

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.

Good catch — updated in 94eae41 to point at the actual replacement: note = "Relies on the hidden global LEGACY_SESSION; use from_arrow_columnar with an explicit ExecutionCtx instead".


Generated by Claude Code

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs requested a review from AdamGS June 8, 2026 13:26
claude added 2 commits June 8, 2026 13:38
Address review feedback: don't create the execution context inside the
`true_count` test helper. The helper now takes `ctx: &mut ExecutionCtx`, and each
test constructs the context explicitly (via `LEGACY_SESSION`) before calling it,
matching the explicit-context pattern used by `from_arrow_columnar`.

Signed-off-by: Claude <noreply@anthropic.com>
The replacement is the new `from_arrow_columnar` (which takes an explicit
`ExecutionCtx`), so name it in the deprecation note instead of the vaguer
"thread an ExecutionCtx through execute_scalar".

Signed-off-by: Claude <noreply@anthropic.com>
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.

4 participants