Skip to content

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

Open
joseph-isaacs wants to merge 3 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 3 commits into
developfrom
claude/sweet-sagan-GoHjV

Conversation

@joseph-isaacs
Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 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.

✅ 1513 untouched benchmarks


Comparing claude/sweet-sagan-GoHjV (de9af5f) with develop (71e8d12)

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
Copy link
Copy Markdown
Contributor

@connortsui20 connortsui20 left a comment

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?

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