Skip to content

Add ARROW_VERSION const to arrow-array - #10957

Merged
Jefffrey merged 1 commit into
apache:mainfrom
ylw510:feat/arrow-array-version-const
Sep 2, 2026
Merged

Jefffrey merged 1 commit into
apache:mainfrom
ylw510:feat/arrow-array-version-const

Conversation

@ylw510

@ylw510 ylw510 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Rationale for this change

The top-level arrow crate already exposes ARROW_VERSION via env!("CARGO_PKG_VERSION") (see #6379). Dependents that only use arrow-array (common for Rust ADBC drivers that need a lean dependency set) currently have no equivalent API, so they may need to fall back to invoking cargo metadata in a build script to report DriverArrowVersion.

That approach is fragile for non-Cargo build systems and adds unnecessary clean-build overhead. Exposing the same constant from arrow-array makes version reporting trivial for everyone implementing Rust ADBC drivers (and any other crate that depends on arrow-array without the umbrella arrow crate).

What changes are included in this PR?

  • Add pub const ARROW_VERSION: &str = env!("CARGO_PKG_VERSION") to arrow-array, matching the existing constant on the top-level arrow crate.

Are there any user-facing changes?

Yes: a new public constant on arrow-array. No breaking changes.

Usage:

use arrow_array::ARROW_VERSION;

Expose the crate version the same way the top-level arrow crate does,
so dependents that only use arrow-array (e.g. Rust ADBC drivers) can
report DriverArrowVersion without invoking cargo metadata at build time.
@github-actions github-actions Bot added arrow Changes to the arrow crate arrow-array labels Sep 2, 2026
@ylw510

ylw510 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Related: ClickHouse/adbc_clickhouse#69

@Rich-T-kid Rich-T-kid 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.

seems simple enough. thanks

@Jefffrey Jefffrey added the enhancement New feature/addition label Sep 2, 2026
@Jefffrey
Jefffrey merged commit c134baf into apache:main Sep 2, 2026
41 checks passed
@Jefffrey

Jefffrey commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

thanks @ylw510 & @Rich-T-kid

ylw510 added a commit to ylw510/adbc_clickhouse that referenced this pull request Sep 5, 2026
Drop the build.rs/cargo_metadata approach so we avoid a Cargo-only build
script; restore when arrow-* is bumped far enough for apache/arrow-rs#10957.
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 18, 2026
# Rationale for this change

The top-level `arrow` crate already exposes `ARROW_VERSION` via
`env!("CARGO_PKG_VERSION")` (see apache#6379). Dependents that only use
`arrow-array` (common for Rust ADBC drivers that need a lean dependency
set) currently have no equivalent API, so they may need to fall back to
invoking `cargo metadata` in a build script to report
`DriverArrowVersion`.

That approach is fragile for non-Cargo build systems and adds
unnecessary clean-build overhead. Exposing the same constant from
`arrow-array` makes version reporting trivial for everyone implementing
Rust ADBC drivers (and any other crate that depends on `arrow-array`
without the umbrella `arrow` crate).

# What changes are included in this PR?

* Add `pub const ARROW_VERSION: &str = env!("CARGO_PKG_VERSION")` to
`arrow-array`, matching the existing constant on the top-level `arrow`
crate.

# Are there any user-facing changes?

Yes: a new public constant on `arrow-array`. No breaking changes.

Usage:

```rust
use arrow_array::ARROW_VERSION;
```
Rich-T-kid pushed a commit to Rich-T-kid/arrow-rs that referenced this pull request Sep 21, 2026
# Rationale for this change

The top-level `arrow` crate already exposes `ARROW_VERSION` via
`env!("CARGO_PKG_VERSION")` (see apache#6379). Dependents that only use
`arrow-array` (common for Rust ADBC drivers that need a lean dependency
set) currently have no equivalent API, so they may need to fall back to
invoking `cargo metadata` in a build script to report
`DriverArrowVersion`.

That approach is fragile for non-Cargo build systems and adds
unnecessary clean-build overhead. Exposing the same constant from
`arrow-array` makes version reporting trivial for everyone implementing
Rust ADBC drivers (and any other crate that depends on `arrow-array`
without the umbrella `arrow` crate).

# What changes are included in this PR?

* Add `pub const ARROW_VERSION: &str = env!("CARGO_PKG_VERSION")` to
`arrow-array`, matching the existing constant on the top-level `arrow`
crate.

# Are there any user-facing changes?

Yes: a new public constant on `arrow-array`. No breaking changes.

Usage:

```rust
use arrow_array::ARROW_VERSION;
```
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-array enhancement New feature/addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants