Skip to content

Commit

Permalink
add "ARROW_VERSION" const (#6379)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin authored Sep 11, 2024
1 parent f050ff7 commit e838e62
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions arrow/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
- [`read_csv.rs`](read_csv.rs): Reading CSV files with explicit schema, pretty printing Arrays
- [`read_csv_infer_schema.rs`](read_csv_infer_schema.rs): Reading CSV files, pretty printing Arrays
- [`tensor_builder.rs`](tensor_builder.rs): Using tensor builder
- [`version.rs`](version.rs): Print the arrow version and exit
24 changes: 24 additions & 0 deletions arrow/examples/version.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

//! Print the arrow version and exit

use arrow::ARROW_VERSION;

fn main() {
println!("arrow version: {ARROW_VERSION}");
}
4 changes: 3 additions & 1 deletion arrow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@
//! [Apache Parquet]: https://parquet.apache.org/
//! [DataFusion]: https://github.com/apache/arrow-datafusion
//! [issue tracker]: https://github.com/apache/arrow-rs/issues
//!

#![deny(clippy::redundant_clone)]
#![warn(missing_debug_implementations)]
Expand All @@ -370,6 +369,9 @@ pub use arrow_array::{downcast_dictionary_array, downcast_primitive_array};

pub use arrow_buffer::{alloc, buffer};

/// Arrow crate version
pub const ARROW_VERSION: &str = env!("CARGO_PKG_VERSION");

pub mod array;
pub mod compute;
#[cfg(feature = "csv")]
Expand Down

0 comments on commit e838e62

Please sign in to comment.