Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion encodings/alp/src/alp/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ pub fn decompress(array: ALPArray) -> PrimitiveArray {
/// # Returns
///
/// A `PrimitiveArray` containing the decompressed values with all patches applied.
#[allow(clippy::cognitive_complexity)]
#[expect(
clippy::cognitive_complexity,
reason = "complexity is from nested match_each_* macros"
)]
pub fn decompress_chunked(
array: ALPArray,
patches: &Patches,
Expand Down
5 changes: 4 additions & 1 deletion encodings/alp/src/alp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ pub trait ALPFloat: private::Sealed + Float + Display + NativePType {
encoded_bytes + patch_bytes
}

#[allow(clippy::type_complexity)]
#[expect(
clippy::type_complexity,
reason = "tuple return type is appropriate for multiple encoding outputs"
)]
fn encode(
values: &[Self],
exponents: Option<Exponents>,
Expand Down
6 changes: 4 additions & 2 deletions encodings/fastlanes/src/rle/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ impl RLEArray {
/// - The `indices` array contains valid indices into chunks of the `values` array
/// - The `values_idx_offsets` array contains valid chunk start offsets
/// - The `validity` array has the same length as `length`
#[allow(clippy::too_many_arguments)]
pub unsafe fn new_unchecked(
values: ArrayRef,
indices: ArrayRef,
Expand Down Expand Up @@ -182,7 +181,10 @@ impl RLEArray {
/// Offsets in `values_idx_offsets` are absolute and need to be shifted
/// by the offset of the first chunk, respective the current slice, in
/// order to make them relative.
#[allow(clippy::expect_used)]
#[expect(
clippy::expect_used,
reason = "expect is safe here as scalar_at returns a valid primitive"
)]
pub(crate) fn values_idx_offset(&self, chunk_idx: usize) -> usize {
self.values_idx_offsets
.scalar_at(chunk_idx)
Expand Down
6 changes: 4 additions & 2 deletions encodings/fastlanes/src/rle/array/rle_decompress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ use crate::FL_CHUNK_SIZE;
use crate::RLEArray;

/// Decompresses an RLE array back into a primitive array.
#[allow(clippy::cognitive_complexity)]
#[expect(
clippy::cognitive_complexity,
reason = "complexity is from nested match_each_* macros"
)]
pub fn rle_decompress(array: &RLEArray) -> PrimitiveArray {
match_each_native_ptype!(array.values().dtype().as_ptype(), |V| {
match_each_unsigned_integer_ptype!(array.values_idx_offsets().dtype().as_ptype(), |O| {
Expand All @@ -37,7 +40,6 @@ pub fn rle_decompress(array: &RLEArray) -> PrimitiveArray {
}

/// Decompresses an `RLEArray` into to a primitive array of unsigned integers.
#[allow(clippy::cognitive_complexity)]
fn rle_decode_typed<V, I, O>(array: &RLEArray) -> PrimitiveArray
where
V: NativePType + RLE + Clone + Copy,
Expand Down
5 changes: 4 additions & 1 deletion encodings/fsst/src/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ impl CanonicalVTable<FSSTVTable> for FSSTVTable {
}
}

#[allow(clippy::cast_possible_truncation)]
#[expect(
clippy::cast_possible_truncation,
reason = "truncation is intentional for buffer index"
)]
fn fsst_decode_views(fsst_array: &FSSTArray, buf_index: u32) -> (ByteBuffer, Buffer<BinaryView>) {
// FSSTArray has two child arrays:
// 1. A VarBinArray, which holds the string heap of the compressed codes.
Expand Down
5 changes: 4 additions & 1 deletion encodings/sparse/src/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ impl CanonicalVTable<SparseVTable> for SparseVTable {
}
}

#[allow(clippy::cognitive_complexity)]
#[expect(
clippy::cognitive_complexity,
reason = "complexity is from nested match_smallest_offset_type macro"
)]
fn canonicalize_sparse_lists(
array: &SparseArray,
values_dtype: Arc<DType>,
Expand Down
1 change: 0 additions & 1 deletion vortex-array/src/arrays/primitive/array/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ impl PrimitiveArray {
}

/// Try to extract a mutable buffer from the PrimitiveArray with zero copy.
#[allow(clippy::panic_in_result_fn)]
pub fn try_into_buffer_mut<T: NativePType>(self) -> Result<BufferMut<T>, PrimitiveArray> {
if T::PTYPE != self.ptype() {
vortex_panic!(
Expand Down
6 changes: 4 additions & 2 deletions vortex-array/src/arrays/primitive/array/patch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use crate::validity::Validity;
use crate::vtable::ValidityHelper;

impl PrimitiveArray {
#[allow(clippy::cognitive_complexity)]
pub fn patch(self, patches: &Patches) -> Self {
let patch_indices = patches.indices().to_primitive();
let patch_values = patches.values().to_primitive();
Expand Down Expand Up @@ -72,7 +71,10 @@ impl PrimitiveArray {
/// * `base_offset` - Base offset from the first chunk
/// * `offset_within_chunk` - Offset within chunk for sliced patches
#[inline]
#[allow(clippy::too_many_arguments)]
#[expect(
clippy::too_many_arguments,
reason = "all arguments are needed for the patching operation"
)]
pub fn patch_chunk<T, I, C>(
decoded_values: &mut [T],
patches_indices: &[I],
Expand Down
1 change: 0 additions & 1 deletion vortex-array/src/arrays/struct_/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ impl StructArray {
/// which specifies the new ordering of columns in the struct. The projection can be used to
/// perform column re-ordering, deletion, or duplication at a logical level, without any data
/// copying.
#[allow(clippy::same_name_method)]
pub fn project(&self, projection: &[FieldName]) -> VortexResult<Self> {
let mut children = Vec::with_capacity(projection.len());
let mut names = Vec::with_capacity(projection.len());
Expand Down
5 changes: 4 additions & 1 deletion vortex-array/src/arrays/varbin/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ impl VarBinArray {
builder.finish(dtype)
}

#[allow(clippy::same_name_method)]
#[expect(
clippy::same_name_method,
reason = "intentionally named from_iter like Iterator::from_iter"
)]
pub fn from_iter<T: AsRef<[u8]>, I: IntoIterator<Item = Option<T>>>(
iter: I,
dtype: DType,
Expand Down
5 changes: 4 additions & 1 deletion vortex-array/src/arrays/varbinview/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,10 @@ impl VarBinViewArray {
}

/// Accumulate an iterable set of values into our type here.
#[allow(clippy::same_name_method)]
#[expect(
clippy::same_name_method,
reason = "intentionally named from_iter like Iterator::from_iter"
)]
pub fn from_iter<T: AsRef<[u8]>, I: IntoIterator<Item = Option<T>>>(
iter: I,
dtype: DType,
Expand Down
5 changes: 4 additions & 1 deletion vortex-array/src/compute/is_sorted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ pub trait IsSortedKernel: VTable {
fn is_strict_sorted(&self, array: &Self::Array) -> VortexResult<Option<bool>>;
}

#[allow(clippy::wrong_self_convention)]
#[expect(
clippy::wrong_self_convention,
reason = "is_* naming follows Iterator::is_sorted convention"
)]
/// Helper methods to check sortedness with strictness
pub trait IsSortedIteratorExt: Iterator
where
Expand Down
5 changes: 4 additions & 1 deletion vortex-array/src/compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ pub enum Output {
Array(ArrayRef),
}

#[allow(clippy::len_without_is_empty)]
#[expect(
clippy::len_without_is_empty,
reason = "Output is always non-empty (scalar has len 1)"
)]
impl Output {
pub fn dtype(&self) -> &DType {
match self {
Expand Down
5 changes: 4 additions & 1 deletion vortex-array/src/patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,10 @@ impl Patches {
}
}

#[allow(clippy::cognitive_complexity)]
#[expect(
clippy::cognitive_complexity,
reason = "complexity is from nested match_each_* macros"
)]
pub fn take_search(
&self,
take_indices: PrimitiveArray,
Expand Down
5 changes: 4 additions & 1 deletion vortex-buffer/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ impl TryFrom<ByteBuffer> for BufferString {

fn try_from(value: ByteBuffer) -> Result<Self, Self::Error> {
simdutf8::basic::from_utf8(value.as_ref()).map_err(|_| {
#[allow(clippy::unwrap_used)]
#[expect(
clippy::unwrap_used,
reason = "unwrap is intentional - the error was already detected"
)]
// run validation using `compat` package to get more detailed error message
let err = simdutf8::compat::from_utf8(value.as_ref()).unwrap_err();
vortex_err!("invalid utf-8: {err}")
Expand Down
7 changes: 5 additions & 2 deletions vortex-datafusion/src/persistent/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ impl GetExt for VortexFormatFactory {

impl VortexFormatFactory {
/// Creates a new instance with a default [`VortexSession`] and default options.
#[allow(clippy::new_without_default)] // FormatFactory defines `default` method, so having `Default` implementation is confusing.
#[expect(
clippy::new_without_default,
reason = "FormatFactory defines `default` method, so having `Default` implementation is confusing"
)]
pub fn new() -> Self {
Self {
session: VortexSession::default(),
Expand Down Expand Up @@ -140,7 +143,7 @@ impl VortexFormatFactory {
}

impl FileFormatFactory for VortexFormatFactory {
#[allow(clippy::disallowed_types)]
#[expect(clippy::disallowed_types, reason = "required by trait signature")]
fn create(
&self,
_state: &dyn Session,
Expand Down
1 change: 0 additions & 1 deletion vortex-dtype/src/arbitrary/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ impl Int for U256Wrapper {
}
}

#[allow(clippy::same_name_method)]
impl Int for i256 {
type Unsigned = U256Wrapper;
const ZERO: Self = i256::ZERO;
Expand Down
5 changes: 0 additions & 5 deletions vortex-dtype/src/arbitrary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ impl<'a> Arbitrary<'a> for PType {
}

impl<'a> Arbitrary<'a> for DecimalDType {
#[allow(
clippy::unwrap_in_result,
clippy::expect_used,
clippy::cast_possible_truncation
)]
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
// Get a random integer for the scale
let precision = u.int_in_range(1..=i256::MAX_PRECISION)?;
Expand Down
10 changes: 8 additions & 2 deletions vortex-dtype/src/bigint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ use vortex_error::VortexExpect;
/// This is one of the physical representations of `DecimalScalar` values and can be safely converted
/// back and forth with Arrow's [`i256`][arrow_buffer::i256].
#[repr(transparent)]
#[allow(non_camel_case_types)]
#[expect(
non_camel_case_types,
reason = "i256 matches Rust primitive naming convention"
)]
#[derive(Debug, Copy, Clone, Default, Eq, PartialEq, Hash, PartialOrd, Ord)]
pub struct i256(arrow_buffer::i256);

#[allow(clippy::same_name_method)]
#[expect(
clippy::same_name_method,
reason = "inherent methods intentionally shadow arrow_buffer::i256 methods"
)]
impl i256 {
/// The zero value for `i256`.
pub const ZERO: Self = Self(arrow_buffer::i256::ZERO);
Expand Down
4 changes: 2 additions & 2 deletions vortex-dtype/src/ptype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ mod private {
}

/// A visitor trait for converting a `NativePType` to another parameterized type.
#[allow(missing_docs)] // Kind of obvious.
#[expect(missing_docs, reason = "method names are self-documenting")]
pub trait PTypeDowncast {
type Output<T: NativePType>;

Expand Down Expand Up @@ -224,7 +224,7 @@ macro_rules! impl_ptype_downcast {
}

/// A visitor trait for converting a generic `NativePType` into a non-parameterized type.
#[allow(missing_docs)] // Kind of obvious.
#[expect(missing_docs, reason = "method names are self-documenting")]
pub trait PTypeUpcast {
type Input<T: NativePType>;

Expand Down
5 changes: 4 additions & 1 deletion vortex-duckdb/src/convert/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ fn like_pattern_str(value: &duckdb::Expression) -> VortexResult<Option<String>>
}
}

#[allow(clippy::cognitive_complexity)]
#[expect(
clippy::cognitive_complexity,
reason = "complexity from exhaustive match on expression types"
)]
pub fn try_from_bound_expression(value: &duckdb::Expression) -> VortexResult<Option<Expression>> {
let Some(value) = value.as_class() else {
log::debug!("no expression class id {:?}", value.as_class_id());
Expand Down
6 changes: 4 additions & 2 deletions vortex-duckdb/src/duckdb/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ impl Vector {
unsafe { LogicalType::own(cpp::duckdb_vector_get_column_type(self.as_ptr())) }
}

#[allow(clippy::expect_used)]
/// Ensure the validity slice is writable.
///
/// # SAFETY
Expand All @@ -186,7 +185,10 @@ impl Vector {
unsafe { self.ensure_validity_slice(capacity) }.view_bits_mut()
}

#[allow(clippy::expect_used)]
#[expect(
clippy::expect_used,
reason = "expect is safe after ensure_validity_writable"
)]
/// Ensure the validity slice is writable.
///
/// # SAFETY
Expand Down
10 changes: 8 additions & 2 deletions vortex-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ use std::sync::PoisonError;
#[derive(Debug)]
pub struct ErrString(Cow<'static, str>);

#[allow(clippy::fallible_impl_from)]
#[expect(
clippy::fallible_impl_from,
reason = "intentionally panic in debug mode when VORTEX_PANIC_ON_ERR is set"
)]
impl<T> From<T> for ErrString
where
T: Into<Cow<'static, str>>,
{
#[allow(clippy::panic)]
#[expect(
clippy::panic,
reason = "intentionally panic in debug mode when VORTEX_PANIC_ON_ERR is set"
)]
fn from(msg: T) -> Self {
if env::var("VORTEX_PANIC_ON_ERR").as_deref().unwrap_or("") == "1" {
panic!("{}\nBacktrace:\n{}", msg.into(), Backtrace::capture());
Expand Down
5 changes: 4 additions & 1 deletion vortex-io/src/io_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,10 @@ mod tests {
#[should_panic(expected = "Invalid range")]
fn test_owned_slice_invalid_range() {
let data = vec![1, 2, 3];
#[allow(clippy::reversed_empty_ranges)]
#[expect(
clippy::reversed_empty_ranges,
reason = "intentionally testing invalid range"
)]
data.slice_owned(5..3); // start > end
}

Expand Down
5 changes: 4 additions & 1 deletion vortex-jni/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ impl NativeArray {
unsafe { Box::from_raw(pointer as *mut NativeArray) }
}

#[allow(clippy::expect_used)]
#[expect(
clippy::expect_used,
reason = "JNI contract guarantees non-null pointer"
)]
pub unsafe fn from_ptr<'a>(pointer: jlong) -> &'a Self {
unsafe {
(pointer as *const NativeArray)
Expand Down
10 changes: 8 additions & 2 deletions vortex-jni/src/array_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ impl NativeArrayIterator {
Box::into_raw(self) as jlong
}

#[allow(clippy::expect_used)]
#[expect(
clippy::expect_used,
reason = "JNI contract guarantees non-null pointer"
)]
pub unsafe fn from_ptr<'a>(pointer: jlong) -> &'a Self {
unsafe {
(pointer as *const NativeArrayIterator)
Expand All @@ -35,7 +38,10 @@ impl NativeArrayIterator {
}
}

#[allow(clippy::expect_used)]
#[expect(
clippy::expect_used,
reason = "JNI contract guarantees non-null pointer"
)]
pub unsafe fn from_ptr_mut<'a>(pointer: jlong) -> &'a mut Self {
unsafe {
(pointer as *mut NativeArrayIterator)
Expand Down
5 changes: 4 additions & 1 deletion vortex-jni/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ impl JNIDefault for jobject {
}

/// Run the provided function inside the JNIEnv context. Throws an exception if the function returns an error.
#[allow(clippy::expect_used)]
#[expect(
clippy::expect_used,
reason = "JNI operations must succeed for proper error handling"
)]
#[inline]
pub fn try_or_throw<'a, F, T>(env: &mut JNIEnv<'a>, function: F) -> T
where
Expand Down
5 changes: 4 additions & 1 deletion vortex-jni/src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ impl NativeFile {
unsafe { Box::from_raw(pointer as *mut NativeFile) }
}

#[allow(clippy::expect_used)]
#[expect(
clippy::expect_used,
reason = "JNI contract guarantees non-null pointer"
)]
pub unsafe fn from_ptr<'a>(pointer: jlong) -> &'a Self {
unsafe {
(pointer as *const NativeFile)
Expand Down
Loading
Loading