Skip to content

Commit 4b5ca6c

Browse files
committed
Revert "UNPICK changes to review"
This reverts commit bd27edc.
1 parent bd27edc commit 4b5ca6c

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

python/datafusion/context.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,11 +731,12 @@ def from_polars(self, data: pl.DataFrame, name: str | None = None) -> DataFrame:
731731
"""
732732
return DataFrame(self.ctx.from_polars(data, name))
733733

734-
# https://github.com/apache/datafusion-python/pull/1016#discussion_r1983239116
735-
# is the discussion on how we arrived at adding register_view
736734
def register_view(self, name: str, df: DataFrame) -> None:
737735
"""Register a :py:class: `~datafusion.detaframe.DataFrame` as a view.
738736
737+
The DataFrame is converted into a view before registration so it can be
738+
referenced from SQL without materializing results immediately.
739+
739740
Args:
740741
name (str): The name to register the view under.
741742
df (DataFrame): The DataFrame to be converted into a view and registered.

src/catalog.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,6 @@ impl CatalogProvider for RustWrappedPyCatalogProvider {
496496
name: &str,
497497
schema: Arc<dyn SchemaProvider>,
498498
) -> datafusion::common::Result<Option<Arc<dyn SchemaProvider>>> {
499-
// JRIGHT HERE
500-
// let py_schema: PySchema = schema.into();
501499
Python::with_gil(|py| {
502500
let py_schema = match schema
503501
.as_any()

src/dataframe.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,7 @@ impl PyDataFrame {
430430

431431
/// Convert this DataFrame into a Table that can be used in register_table
432432
/// By convention, into_... methods consume self and return the new object.
433-
/// Disabling the clippy lint, so we can use &self
434-
/// because we're working with Python bindings
435-
/// where objects are shared
436-
/// https://github.com/apache/datafusion-python/pull/1016#discussion_r1983239116
437-
/// - we have not decided on the table_provider approach yet
433+
/// Here we intentionally borrow to avoid invalidating the Python wrapper.
438434
#[allow(clippy::wrong_self_convention)]
439435
fn into_view(&self) -> PyDataFusionResult<PyTable> {
440436
// Call the underlying Rust DataFrame::into_view method.

0 commit comments

Comments
 (0)