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
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ roaring = "0.11.0"
rstest = "0.26"
rstest_reuse = "0.7.0"
rustc-hash = "2.1"
serde = "1.0.217"
serde = "1.0.220"
serde_core = "1.0.220"
serde_json = "1.0.116"
serde_test = "1.0.176"
simdutf8 = "0.1.5"
Expand Down
1 change: 0 additions & 1 deletion vortex-array/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ rand = { workspace = true }
rstest = { workspace = true, optional = true }
rstest_reuse = { workspace = true, optional = true }
rustc-hash = { workspace = true }
serde = { workspace = true, features = ["derive"] }
simdutf8 = { workspace = true }
static_assertions = { workspace = true }
tabled = { workspace = true, optional = true, default-features = false, features = [
Expand Down
3 changes: 1 addition & 2 deletions vortex-array/src/patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::ops::Range;

use arrow_buffer::BooleanBuffer;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use vortex_buffer::BufferMut;
use vortex_dtype::Nullability::NonNullable;
use vortex_dtype::{
Expand All @@ -26,7 +25,7 @@ use crate::search_sorted::{SearchResult, SearchSorted, SearchSortedSide};
use crate::vtable::ValidityHelper;
use crate::{Array, ArrayRef, IntoArray, ToCanonical};

#[derive(Copy, Clone, Serialize, Deserialize, prost::Message)]
#[derive(Copy, Clone, prost::Message)]
pub struct PatchesMetadata {
#[prost(uint64, tag = "1")]
len: u64,
Expand Down
4 changes: 2 additions & 2 deletions vortex-buffer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ all-features = true
arrow = ["dep:arrow-buffer"]
cuda = ["dep:cudarc"]
memmap2 = ["dep:memmap2"]
serde = ["dep:serde"]
serde = ["dep:serde_core"]
warn-copy = ["dep:log"]

[dependencies]
Expand All @@ -31,7 +31,7 @@ itertools = { workspace = true }
log = { workspace = true, optional = true }
memmap2 = { workspace = true, optional = true }
num-traits = { workspace = true }
serde = { workspace = true, optional = true }
serde_core = { workspace = true, optional = true }
simdutf8 = { workspace = true }
vortex-error = { workspace = true }

Expand Down
12 changes: 6 additions & 6 deletions vortex-buffer/src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

use std::marker::PhantomData;

use serde::de::Visitor;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_core::de::Visitor;
use serde_core::{Deserialize, Deserializer, Serialize, Serializer};

use crate::{Alignment, Buffer, BufferMut, ByteBuffer};

Expand Down Expand Up @@ -44,31 +44,31 @@ where

fn visit_byte_buf<E>(self, v: Vec<u8>) -> Result<Self::Value, E>
where
E: serde::de::Error,
E: serde_core::de::Error,
{
let bytes = ByteBuffer::copy_from_aligned(v, Alignment::of::<T>());
Ok(Buffer::from_byte_buffer(bytes))
}

fn visit_borrowed_bytes<E>(self, v: &'de [u8]) -> Result<Self::Value, E>
where
E: serde::de::Error,
E: serde_core::de::Error,
{
let bytes = ByteBuffer::copy_from_aligned(v, Alignment::of::<T>());
Ok(Buffer::from_byte_buffer(bytes))
}

fn visit_bytes<E>(self, v: &[u8]) -> Result<Self::Value, E>
where
E: serde::de::Error,
E: serde_core::de::Error,
{
let bytes = ByteBuffer::copy_from_aligned(v, Alignment::of::<T>());
Ok(Buffer::from_byte_buffer(bytes))
}

fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
where
A: serde::de::SeqAccess<'de>,
A: serde_core::de::SeqAccess<'de>,
{
let mut buffer = seq
.size_hint()
Expand Down
1 change: 1 addition & 0 deletions vortex-dtype/src/serde/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub mod flatbuffers;
mod proto;

#[allow(clippy::module_inception)]
#[cfg(feature = "serde")]
mod serde;

#[cfg(test)]
Expand Down
2 changes: 0 additions & 2 deletions vortex-dtype/src/serde/serde.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#![cfg(feature = "serde")]

use serde::{Deserialize, Deserializer, Serialize, Serializer};

use crate::Nullability;
Expand Down
Loading