diff --git a/CHANGELOG.md b/CHANGELOG.md index e2da291..0bddd28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Minarrow Rust +## 0.18.3 - 2026-10-01 Nightly Compatibility Release + +## Added +* `arrow_type` on `NumericArray`, `TextArray` and `TemporalArray`. +* `Value::fields`, returning the fields that describe a value's columns. +* `PyInput` and `From` implementations in minarrow-py. + +## Maintenance +* Compatibility with the 2026-09-30 Rust nightly, which moves the unstable allocator surface to `allocator_ext`. Requires that nightly or later. +* Upgraded vec64 to 0.5.3. + ## 0.18.2 Minor Enhancements Release ## Added @@ -33,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -* Typed, row-wise accessors (e.g., `.get_u64(i)`) on `ArrayView` including hot path variants that skip bounds checks. +* Typed, row-wise accessors (e.g., `.get_u64(i)`) on `ArrayView` including hot path variants that skip bounds checks. * **Decimal array support** behind the `decimal` feature flag. * Added `DecimalArray` for Decimal32, Decimal64, and Decimal128. * Supports configurable precision and scale. @@ -57,8 +68,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Adds `SuperArray::check_type_uniformity()`, gated to the same feature, reporting whether all chunks have the same `ArrowType`. * Ensures that a `Field`, when present, still guarantees that describes every chunk. Attaching a field to non-uniform chunks is rejected. Hence, it is not possible to create - a `SuperTable` with mixed `SuperArray`s either, as that would be contractually incorrect. -* With the feature off, behaviour is unchanged. + a `SuperTable` with mixed `SuperArray`s either, as that would be contractually incorrect. +* With the feature off, behaviour is unchanged. * `fa_dt32!` and `fa_dt64!` macros for building a named `FieldArray` of datetimes. * KernelError::Overflow(String) enum error type. diff --git a/Cargo.lock b/Cargo.lock index 47af284..dbea0f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -901,7 +901,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "minarrow" -version = "0.18.2" +version = "0.18.3" dependencies = [ "ahash", "arrow", diff --git a/Cargo.toml b/Cargo.toml index af66167..c3f2586 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "minarrow" -version = "0.18.2" +version = "0.18.3" edition = "2024" authors = ['Peter G. Bower'] build = "build.rs" +# Gives dependent build scripts the source root as `DEP_MINARROW_ROOT`, for +# generators that read minarrow's conversions with `syn`. +links = "minarrow" license = "Apache-2.0" readme = "README.md" repository = "https://github.com/pbower/minarrow" diff --git a/build.rs b/build.rs index bb747bc..a6e3ace 100644 --- a/build.rs +++ b/build.rs @@ -22,6 +22,12 @@ fn has_feature(list: &str, feature: &str) -> bool { } fn main() { + // The source root, published to dependent build scripts as `DEP_MINARROW_ROOT`. + println!( + "cargo:root={}", + env::var("CARGO_MANIFEST_DIR").expect("cargo sets CARGO_MANIFEST_DIR") + ); + //////////////////////////////////////////////////////////////// // C-FFI Integration tests //////////////////////////////////////////////////////////////// diff --git a/minarrow-py/Cargo.lock b/minarrow-py/Cargo.lock index c0eb64c..1676d20 100644 --- a/minarrow-py/Cargo.lock +++ b/minarrow-py/Cargo.lock @@ -28,7 +28,7 @@ checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" [[package]] name = "minarrow" -version = "0.18.2" +version = "0.18.3" dependencies = [ "log", "num-traits", @@ -48,7 +48,7 @@ dependencies = [ [[package]] name = "minarrow-pyo3" -version = "0.18.2" +version = "0.18.3" dependencies = [ "minarrow", "pyo3", @@ -197,6 +197,6 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "vec64" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54db55dbf75205d7a52f11a60aa6742d0ce6a9eb3ed97346556f26aec246f139" +checksum = "662d4c3c6fe8d14a8b4a0b97155a0b22dd6d9b6626f42224be6987b0e0f1ca2b" diff --git a/minarrow-py/Cargo.toml b/minarrow-py/Cargo.toml index f0bba83..fea541c 100644 --- a/minarrow-py/Cargo.toml +++ b/minarrow-py/Cargo.toml @@ -11,6 +11,9 @@ homepage = "https://github.com/pbower/minarrow" readme = "README.md" keywords = ["arrow", "columnar", "dataframe", "pyarrow", "analytics"] description = "Minimal, straightforward and fast SIMD-compatible Apache Arrow inter-op for Python." +# Gives dependent build scripts the source root as `DEP_MINARROW_PY_ROOT`, for +# generators that read the conversions from the Python classes with `syn`. +links = "minarrow_py" [workspace] diff --git a/minarrow-py/build.rs b/minarrow-py/build.rs index 0475124..08885da 100644 --- a/minarrow-py/build.rs +++ b/minarrow-py/build.rs @@ -1,3 +1,8 @@ fn main() { pyo3_build_config::use_pyo3_cfgs(); + // The source root, published to dependent build scripts as `DEP_MINARROW_PY_ROOT`. + println!( + "cargo:root={}", + std::env::var("CARGO_MANIFEST_DIR").expect("cargo sets CARGO_MANIFEST_DIR") + ); } diff --git a/minarrow-py/rust-toolchain.toml b/minarrow-py/rust-toolchain.toml index 46cc5ff..5237b73 100644 --- a/minarrow-py/rust-toolchain.toml +++ b/minarrow-py/rust-toolchain.toml @@ -1,4 +1,4 @@ -# minarrow (through vec64) uses allocator_api and portable_simd, which are only +# minarrow (through vec64) uses allocator_ext and portable_simd, which are only # available on the nightly toolchain. cargo selects it automatically here, so # local builds, CI, and source installs all use the right channel. [toolchain] diff --git a/minarrow-py/src/array.rs b/minarrow-py/src/array.rs index 9f504a5..95efc80 100644 --- a/minarrow-py/src/array.rs +++ b/minarrow-py/src/array.rs @@ -405,6 +405,16 @@ impl From<&PyArray> for ArrayV { } } +impl From<&PyArray> for Array { + fn from(py_array: &PyArray) -> Self { + match &py_array.0 { + PyArrayInner::Array(array) => (**array).clone(), + PyArrayInner::Field(field) => field.array.clone(), + PyArrayInner::View(view) => view.to_array(), + } + } +} + #[pymethods] impl PyArray { /// Construct from a Python sequence, inferring the dtype. `None` elements diff --git a/minarrow-py/src/arrow_type.rs b/minarrow-py/src/arrow_type.rs index dbd8085..5d5bd95 100644 --- a/minarrow-py/src/arrow_type.rs +++ b/minarrow-py/src/arrow_type.rs @@ -63,6 +63,13 @@ impl From for TimeUnit { } } +#[cfg(feature = "datetime")] +impl From<&PyTimeUnit> for TimeUnit { + fn from(unit: &PyTimeUnit) -> Self { + (*unit).into() + } +} + /// The unit of an interval type. Mirrors `minarrow::IntervalUnit`. #[cfg(feature = "datetime")] #[pyclass(from_py_object, eq, eq_int, name = "IntervalUnit", module = "minarrow")] @@ -296,6 +303,12 @@ py_arrow_type_numeric!([ Dictionary { index: PyCategoricalIndexType }, ]); +impl From<&PyArrowType> for ArrowType { + fn from(dtype: &PyArrowType) -> Self { + dtype.clone().into() + } +} + #[pymethods] impl PyArrowType { fn __repr__(&self) -> String { diff --git a/minarrow-py/src/cube.rs b/minarrow-py/src/cube.rs index 7b2f6d0..c639034 100644 --- a/minarrow-py/src/cube.rs +++ b/minarrow-py/src/cube.rs @@ -41,6 +41,18 @@ impl From for PyCube { } } +impl From<&PyCube> for Cube { + fn from(py_cube: &PyCube) -> Self { + (*py_cube.0).clone() + } +} + +impl From<&PyCube> for Arc { + fn from(py_cube: &PyCube) -> Self { + py_cube.0.clone() + } +} + /// The table at `index`, as the Python object carrying it. fn table_at(cube: &Cube, index: usize) -> Option { cube.table(index) diff --git a/minarrow-py/src/field.rs b/minarrow-py/src/field.rs index 01f4cde..d486738 100644 --- a/minarrow-py/src/field.rs +++ b/minarrow-py/src/field.rs @@ -33,6 +33,12 @@ use crate::dtype::{dtype_from_arrow, DType}; #[derive(Clone)] pub struct PyField(pub Field); +impl From<&PyField> for Field { + fn from(py_field: &PyField) -> Self { + py_field.0.clone() + } +} + #[pymethods] impl PyField { /// Construct from a name and an `ArrowType`. `metadata` is a string mapping. diff --git a/minarrow-py/src/matrix.rs b/minarrow-py/src/matrix.rs index 83c4730..673d8b9 100644 --- a/minarrow-py/src/matrix.rs +++ b/minarrow-py/src/matrix.rs @@ -43,6 +43,12 @@ impl From for PyMatrix { } } +impl From<&PyMatrix> for Matrix { + fn from(py_matrix: &PyMatrix) -> Self { + py_matrix.0.clone() + } +} + #[pymethods] impl PyMatrix { /// Build a matrix from rows, each row a list of the same length. diff --git a/minarrow-py/src/table.rs b/minarrow-py/src/table.rs index 696cc8f..e32df84 100644 --- a/minarrow-py/src/table.rs +++ b/minarrow-py/src/table.rs @@ -365,6 +365,30 @@ impl From for PyTable { } } +impl From<&PyTable> for TableV { + fn from(py_table: &PyTable) -> Self { + py_table.0.as_view() + } +} + +impl From<&PyTable> for Table { + fn from(py_table: &PyTable) -> Self { + match &py_table.0 { + PyTableInner::Owned(table) => (**table).clone(), + PyTableInner::View(view) => view.to_table(), + } + } +} + +impl From<&PyTable> for Arc { + fn from(py_table: &PyTable) -> Self { + match &py_table.0 { + PyTableInner::Owned(table) => table.clone(), + PyTableInner::View(view) => Arc::new(view.to_table()), + } + } +} + #[pymethods] impl PyTable { /// Construct from a dict of column name to sequence. Columns must share a diff --git a/pyo3/CHANGELOG.md b/pyo3/CHANGELOG.md index e61bfd5..ef71e7f 100644 --- a/pyo3/CHANGELOG.md +++ b/pyo3/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.18.3] - 2026-10-01 +- Bumped `minarrow` dependency from 0.18.2 to 0.18.3 for compatibility with the 2026-09-30 Rust nightly. + ## [0.18.2] - 2026-09-19 - Bumped `minarrow` dependency from 0.18.1 to 0.18.2. diff --git a/pyo3/Cargo.lock b/pyo3/Cargo.lock index 60b8e05..ee7403c 100644 --- a/pyo3/Cargo.lock +++ b/pyo3/Cargo.lock @@ -28,7 +28,7 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "minarrow" -version = "0.18.2" +version = "0.18.3" dependencies = [ "log", "num-traits", @@ -37,7 +37,7 @@ dependencies = [ [[package]] name = "minarrow-pyo3" -version = "0.18.2" +version = "0.18.3" dependencies = [ "minarrow", "pyo3", @@ -186,6 +186,6 @@ checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "vec64" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54db55dbf75205d7a52f11a60aa6742d0ce6a9eb3ed97346556f26aec246f139" +checksum = "662d4c3c6fe8d14a8b4a0b97155a0b22dd6d9b6626f42224be6987b0e0f1ca2b" diff --git a/pyo3/Cargo.toml b/pyo3/Cargo.toml index 42b41be..b7531a6 100644 --- a/pyo3/Cargo.toml +++ b/pyo3/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minarrow-pyo3" -version = "0.18.2" +version = "0.18.3" edition = "2024" authors = ['Peter G. Bower'] license = "Apache-2.0" @@ -24,7 +24,7 @@ name = "minarrow_pyo3" crate-type = ["cdylib", "rlib"] [dependencies] -minarrow = { version = "0.18.2", path = "..", features = ["large_string"] } +minarrow = { version = "0.18.3", path = "..", features = ["large_string"] } pyo3 = { version = "0.29" } thiserror = "2"