This is an automated email from the ASF dual-hosted git repository.

Jefffrey pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new c134baf8fc Add `ARROW_VERSION` const to arrow-array (#10957)
c134baf8fc is described below

commit c134baf8fc1f01be8d3ff1c9a329daf897d74623
Author: yanglongwei <[email protected]>
AuthorDate: Thu Sep 3 02:23:30 2026 +0800

    Add `ARROW_VERSION` const to arrow-array (#10957)
    
    # 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:
    
    ```rust
    use arrow_array::ARROW_VERSION;
    ```
---
 arrow-array/src/lib.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arrow-array/src/lib.rs b/arrow-array/src/lib.rs
index a5f9bf5e71..e826a0e9bc 100644
--- a/arrow-array/src/lib.rs
+++ b/arrow-array/src/lib.rs
@@ -229,6 +229,9 @@
 #![deny(rustdoc::broken_intra_doc_links)]
 #![warn(missing_docs)]
 
+/// Arrow crate version
+pub const ARROW_VERSION: &str = env!("CARGO_PKG_VERSION");
+
 pub mod array;
 pub use array::*;
 

Reply via email to