Skip to content

Commit 911b4a2

Browse files
committed
fix: rename into_view_provider to to_view_provider for clarity
1 parent c555319 commit 911b4a2

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/dataframe.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ impl PyDataFrame {
268268
}
269269
}
270270

271-
#[allow(clippy::wrong_self_convention)]
272-
pub(crate) fn into_view_provider(&self) -> Arc<dyn TableProvider + Send> {
271+
pub(crate) fn to_view_provider(&self) -> Arc<dyn TableProvider + Send> {
273272
self.df.as_ref().clone().into_view()
274273
}
275274

@@ -400,17 +399,14 @@ impl PyDataFrame {
400399

401400
/// Convert this DataFrame into a Table that can be used in register_table
402401
/// By convention, into_... methods consume self and return the new object.
403-
/// Disabling the clippy lint, so we can use &self
404-
/// because we're working with Python bindings
405-
/// where objects are shared
402+
/// Here we intentionally borrow to avoid invalidating the Python wrapper.
406403
/// https://github.com/apache/datafusion-python/pull/1016#discussion_r1983239116
407404
/// - we have not decided on the table_provider approach yet
408-
#[allow(clippy::wrong_self_convention)]
409405
pub fn into_view(&self) -> PyDataFusionResult<PyTableProvider> {
410406
// Call the underlying Rust DataFrame::into_view method.
411407
// Note that the Rust method consumes self; here we clone the inner Arc<DataFrame>
412408
// so that we don't invalidate this PyDataFrame.
413-
let table_provider = self.into_view_provider();
409+
let table_provider = self.to_view_provider();
414410
Ok(PyTableProvider::new(table_provider))
415411
}
416412

src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl PyTableProvider {
8080
/// This method simply delegates to `DataFrame.into_view`.
8181
#[staticmethod]
8282
pub fn from_dataframe(df: &PyDataFrame) -> PyDataFusionResult<Self> {
83-
let table_provider = df.into_view_provider();
83+
let table_provider = df.to_view_provider();
8484
Ok(Self::new(table_provider))
8585
}
8686

0 commit comments

Comments
 (0)