Skip to content

Commit 3254fed

Browse files
committed
Fix tests
Signed-off-by: Nicholas Gates <[email protected]>
1 parent ec07c03 commit 3254fed

13 files changed

Lines changed: 44 additions & 44 deletions

File tree

‎vortex-array/src/arrays/extension/vtable/rules.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mod tests {
5555
use vortex_dtype::Nullability;
5656
use vortex_dtype::PType;
5757
use vortex_dtype::extension::EmptyOptions;
58-
use vortex_dtype::extension::VTable;
58+
use vortex_dtype::extension::ExtDTypeVTable;
5959
use vortex_error::VortexResult;
6060
use vortex_mask::Mask;
6161
use vortex_scalar::Scalar;
@@ -75,7 +75,7 @@ mod tests {
7575

7676
#[derive(Clone, Debug, Default)]
7777
struct TestExt;
78-
impl VTable for TestExt {
78+
impl ExtDTypeVTable for TestExt {
7979
type Options = EmptyOptions;
8080

8181
fn id(&self) -> ExtID {
@@ -155,7 +155,7 @@ mod tests {
155155
fn test_scalar_fn_no_pushdown_different_ext_types() {
156156
#[derive(Clone, Debug, Default)]
157157
struct TestExt2;
158-
impl VTable for TestExt2 {
158+
impl ExtDTypeVTable for TestExt2 {
159159
type Options = EmptyOptions;
160160

161161
fn id(&self) -> ExtID {

‎vortex-dtype/src/datetime/date.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::ExtDType;
1111
use crate::Nullability;
1212
use crate::PType;
1313
use crate::datetime::TimeUnit;
14+
use crate::extension::ExtDTypeVTable;
1415
use crate::extension::ExtID;
15-
use crate::extension::VTable;
1616

1717
/// Date DType.
1818
#[derive(Clone, Debug, Default)]
@@ -38,7 +38,7 @@ impl Date {
3838
}
3939
}
4040

41-
impl VTable for Date {
41+
impl ExtDTypeVTable for Date {
4242
type Options = TimeUnit;
4343

4444
fn id(&self) -> ExtID {

‎vortex-dtype/src/datetime/matcher.rs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use crate::datetime::Time;
1010
use crate::datetime::Timestamp;
1111
use crate::datetime::TimestampOptions;
1212
use crate::extension::ExtDTypeRef;
13+
use crate::extension::ExtDTypeVTable;
1314
use crate::extension::Matcher;
14-
use crate::extension::VTable;
1515

1616
/// Matcher for temporal extension data types.
1717
pub struct AnyTemporal;
@@ -37,11 +37,11 @@ impl Matcher for AnyTemporal {
3737
#[derive(Debug, PartialEq, Eq)]
3838
pub enum TemporalOptions<'a> {
3939
/// Options for Timestamp dtypes
40-
Timestamp(&'a <Timestamp as VTable>::Options),
40+
Timestamp(&'a <Timestamp as ExtDTypeVTable>::Options),
4141
/// Options for Date dtypes
42-
Date(&'a <Date as VTable>::Options),
42+
Date(&'a <Date as ExtDTypeVTable>::Options),
4343
/// Options for Time dtypes
44-
Time(&'a <Time as VTable>::Options),
44+
Time(&'a <Time as ExtDTypeVTable>::Options),
4545
}
4646

4747
// TODO(ngates): remove this logic in favor of having an ExtScalarVTable in vortex-scalar.

‎vortex-dtype/src/datetime/time.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use crate::ExtDType;
1111
use crate::Nullability;
1212
use crate::PType;
1313
use crate::datetime::TimeUnit;
14+
use crate::extension::ExtDTypeVTable;
1415
use crate::extension::ExtID;
15-
use crate::extension::VTable;
1616

1717
/// Time DType.
1818
#[derive(Clone, Debug, Default)]
@@ -34,7 +34,7 @@ impl Time {
3434
}
3535
}
3636

37-
impl VTable for Time {
37+
impl ExtDTypeVTable for Time {
3838
type Options = TimeUnit;
3939

4040
fn id(&self) -> ExtID {

‎vortex-dtype/src/datetime/timestamp.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use crate::ExtDType;
1818
use crate::Nullability;
1919
use crate::PType;
2020
use crate::datetime::TimeUnit;
21+
use crate::extension::ExtDTypeVTable;
2122
use crate::extension::ExtID;
22-
use crate::extension::VTable;
2323

2424
/// Timestamp DType.
2525
#[derive(Clone, Debug, Default)]
@@ -66,7 +66,7 @@ impl Display for TimestampOptions {
6666
}
6767
}
6868

69-
impl VTable for Timestamp {
69+
impl ExtDTypeVTable for Timestamp {
7070
type Options = TimestampOptions;
7171

7272
fn id(&self) -> ExtID {

‎vortex-dtype/src/extension/matcher.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use crate::extension::ExtDTypeAdapter;
55
use crate::extension::ExtDTypeRef;
6-
use crate::extension::VTable;
6+
use crate::extension::ExtDTypeVTable;
77

88
/// A trait for matching extension dtypes.
99
pub trait Matcher {
@@ -19,7 +19,7 @@ pub trait Matcher {
1919
fn try_match<'a>(item: &'a ExtDTypeRef) -> Option<Self::Match<'a>>;
2020
}
2121

22-
impl<V: VTable> Matcher for V {
22+
impl<V: ExtDTypeVTable> Matcher for V {
2323
type Match<'a> = &'a V::Options;
2424

2525
fn matches(item: &ExtDTypeRef) -> bool {

‎vortex-dtype/src/extension/mod.rs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ pub type ExtID = ArcRef<str>;
3030

3131
/// An extension data type.
3232
#[derive(Clone)]
33-
pub struct ExtDType<V: VTable>(Arc<ExtDTypeAdapter<V>>);
33+
pub struct ExtDType<V: ExtDTypeVTable>(Arc<ExtDTypeAdapter<V>>);
3434

3535
// Convenience impls for zero-sized VTables
36-
impl<V: VTable + Default> ExtDType<V> {
36+
impl<V: ExtDTypeVTable + Default> ExtDType<V> {
3737
/// Creates a new extension dtype with the given options and storage dtype.
3838
pub fn try_new(options: V::Options, storage_dtype: DType) -> VortexResult<Self> {
3939
Self::try_with_vtable(V::default(), options, storage_dtype)
4040
}
4141
}
4242

43-
impl<V: VTable> ExtDType<V> {
43+
impl<V: ExtDTypeVTable> ExtDType<V> {
4444
/// Creates a new extension dtype with the given options and storage dtype.
4545
pub fn try_with_vtable(
4646
vtable: V,
@@ -175,7 +175,7 @@ impl ExtDTypeRef {
175175
/// Downcast to the concrete options type.
176176
///
177177
/// Returns `Err(self)` if the downcast fails.
178-
pub fn try_downcast<V: VTable>(self) -> Result<ExtDType<V>, ExtDTypeRef> {
178+
pub fn try_downcast<V: ExtDTypeVTable>(self) -> Result<ExtDType<V>, ExtDTypeRef> {
179179
// Check if the concrete type matches
180180
if self.0.as_any().is::<ExtDTypeAdapter<V>>() {
181181
// SAFETY: type matches and ExtDTypeImpl<V> is the only implementor
@@ -192,7 +192,7 @@ impl ExtDTypeRef {
192192
/// # Panics
193193
///
194194
/// Panics if the downcast fails.
195-
pub fn downcast<V: VTable>(self) -> ExtDType<V> {
195+
pub fn downcast<V: ExtDTypeVTable>(self) -> ExtDType<V> {
196196
self.try_downcast::<V>()
197197
.map_err(|this| {
198198
vortex_err!(
@@ -256,13 +256,13 @@ trait ExtDTypeImpl: 'static + Send + Sync + private::Sealed {
256256
fn with_nullability(&self, nullability: Nullability) -> ExtDTypeRef;
257257
}
258258

259-
struct ExtDTypeAdapter<V: VTable> {
259+
struct ExtDTypeAdapter<V: ExtDTypeVTable> {
260260
vtable: V,
261261
options: V::Options,
262262
storage_dtype: DType,
263263
}
264264

265-
impl<V: VTable> ExtDTypeImpl for ExtDTypeAdapter<V> {
265+
impl<V: ExtDTypeVTable> ExtDTypeImpl for ExtDTypeAdapter<V> {
266266
fn as_any(&self) -> &dyn Any {
267267
self
268268
}
@@ -313,5 +313,5 @@ mod private {
313313
use super::ExtDTypeAdapter;
314314

315315
pub trait Sealed {}
316-
impl<V: super::VTable> Sealed for ExtDTypeAdapter<V> {}
316+
impl<V: super::ExtDTypeVTable> Sealed for ExtDTypeAdapter<V> {}
317317
}

‎vortex-dtype/src/extension/vtable.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::extension::ExtDTypeRef;
2222
// deserialize function).
2323

2424
/// The public API for defining new extension DTypes.
25-
pub trait VTable: 'static + Sized + Send + Sync + Clone + Debug {
25+
pub trait ExtDTypeVTable: 'static + Sized + Send + Sync + Clone + Debug {
2626
/// Associated type containing the deserialized metadata for this extension type
2727
type Options: 'static + Send + Sync + Clone + Debug + Display + Eq + Hash;
2828

@@ -55,7 +55,7 @@ pub trait VTable: 'static + Sized + Send + Sync + Clone + Debug {
5555
}
5656

5757
/// A dynamic vtable for extension types, used for type-erased deserialization.
58-
// FIXME(ngates): consider renaming this to ExtDTypePlugin or similar?
58+
// TODO(ngates): consider renaming this to ExtDTypePlugin or similar?
5959
pub trait DynVTable: 'static + Send + Sync + Debug {
6060
/// Returns the ID for this extension type.
6161
fn id(&self) -> ExtID;
@@ -67,13 +67,13 @@ pub trait DynVTable: 'static + Send + Sync + Debug {
6767
fn clone_box(&self) -> Box<dyn DynVTable>;
6868
}
6969

70-
impl<V: VTable> DynVTable for V {
70+
impl<V: ExtDTypeVTable> DynVTable for V {
7171
fn id(&self) -> ExtID {
72-
VTable::id(self)
72+
ExtDTypeVTable::id(self)
7373
}
7474

7575
fn deserialize(&self, data: &[u8], storage_dtype: DType) -> VortexResult<ExtDTypeRef> {
76-
let options = VTable::deserialize(self, data)?;
76+
let options = ExtDTypeVTable::deserialize(self, data)?;
7777
Ok(ExtDType::try_with_vtable(self.clone(), options, storage_dtype)?.erased())
7878
}
7979

‎vortex-dtype/src/session.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::datetime::Date;
1313
use crate::datetime::Time;
1414
use crate::datetime::Timestamp;
1515
use crate::extension::DynVTable;
16-
use crate::extension::VTable;
16+
use crate::extension::ExtDTypeVTable;
1717

1818
/// Registry for extension dtypes.
1919
pub type ExtDTypeRegistry = Registry<Arc<dyn DynVTable>>;
@@ -41,7 +41,7 @@ impl Default for DTypeSession {
4141

4242
impl DTypeSession {
4343
/// Register an extension DType with the Vortex session.
44-
pub fn register<V: VTable>(&self, vtable: V) {
44+
pub fn register<V: ExtDTypeVTable>(&self, vtable: V) {
4545
self.registry
4646
.register(vtable.id(), Arc::new(vtable) as Arc<dyn DynVTable>);
4747
}

‎vortex-duckdb/src/convert/dtype.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ mod tests {
338338
use vortex::dtype::datetime::Time;
339339
use vortex::dtype::datetime::Timestamp;
340340
use vortex::dtype::extension::EmptyOptions;
341-
use vortex::dtype::extension::VTable;
341+
use vortex::dtype::extension::ExtDTypeVTable;
342342
use vortex::error::VortexResult;
343343

344344
use crate::cpp;
@@ -571,7 +571,7 @@ mod tests {
571571

572572
#[derive(Clone, Debug, Default)]
573573
struct TestExt;
574-
impl VTable for TestExt {
574+
impl ExtDTypeVTable for TestExt {
575575
type Options = EmptyOptions;
576576

577577
fn id(&self) -> ExtID {

0 commit comments

Comments
 (0)