diff --git a/rust/lancedb/src/remote/table.rs b/rust/lancedb/src/remote/table.rs index d1bd32f9..b11dd496 100644 --- a/rust/lancedb/src/remote/table.rs +++ b/rust/lancedb/src/remote/table.rs @@ -5,11 +5,11 @@ use std::io::Cursor; use std::pin::Pin; use std::sync::{Arc, Mutex}; +use crate::index::Index; use crate::index::IndexStatistics; use crate::query::{QueryFilter, QueryRequest, Select, VectorQueryRequest}; use crate::table::{AddDataMode, AnyQuery, Filter}; use crate::utils::{supported_btree_data_type, supported_vector_data_type}; -use crate::{index::Index, table::dataset}; use crate::{DistanceType, Error, Table}; use arrow_array::RecordBatchReader; use arrow_ipc::reader::FileReader; @@ -396,9 +396,6 @@ impl BaseTable for RemoteTable { fn name(&self) -> &str { &self.name } - fn dataset(&self) -> &dataset::DatasetConsistencyWrapper { - unimplemented!() - } async fn version(&self) -> Result { self.describe().await.map(|desc| desc.version) } diff --git a/rust/lancedb/src/table.rs b/rust/lancedb/src/table.rs index db40093a..692b5d75 100644 --- a/rust/lancedb/src/table.rs +++ b/rust/lancedb/src/table.rs @@ -410,8 +410,6 @@ pub trait BaseTable: std::fmt::Display + std::fmt::Debug + Send + Sync { fn as_any(&self) -> &dyn std::any::Any; /// Get the name of the table. fn name(&self) -> &str; - /// Get the dataset of the table. - fn dataset(&self) -> &dataset::DatasetConsistencyWrapper; /// Get the arrow [Schema] of the table. async fn schema(&self) -> Result; /// Count the number of rows in this table. @@ -583,9 +581,11 @@ impl Table { self.inner.name() } - /// Get the dataset of the table. - pub fn dataset(&self) -> &dataset::DatasetConsistencyWrapper { - self.inner.dataset() + /// Get the dataset of the table if it is a native table + /// + /// Returns None otherwise + pub fn dataset(&self) -> Option<&dataset::DatasetConsistencyWrapper> { + self.inner.as_native().map(|t| &t.dataset) } /// Get the arrow [Schema] of the table. @@ -1865,10 +1865,6 @@ impl BaseTable for NativeTable { self.name.as_str() } - fn dataset(&self) -> &dataset::DatasetConsistencyWrapper { - &self.dataset - } - async fn version(&self) -> Result { Ok(self.dataset.get().await?.version().version) }