diff --git a/python/datafusion/context.py b/python/datafusion/context.py index f6bf1c6c..903d4a10 100644 --- a/python/datafusion/context.py +++ b/python/datafusion/context.py @@ -73,7 +73,7 @@ def with_create_default_catalog_and_schema( def with_default_catalog_and_schema( self, catalog: str, schema: str ) -> SessionConfig: - """Select a name for the default catalog and shcema. + """Select a name for the default catalog and schema. Args: catalog: Catalog name. @@ -517,7 +517,7 @@ def sql(self, query: str, options: SQLOptions | None = None) -> DataFrame: def sql_with_options(self, query: str, options: SQLOptions) -> DataFrame: """Create a :py:class:`~datafusion.dataframe.DataFrame` from SQL query text. - This function will first validating that the query is allowed by the + This function will first validate that the query is allowed by the provided options. Args: @@ -636,12 +636,14 @@ def from_polars(self, data: polars.DataFrame, name: str | None = None) -> DataFr """ return DataFrame(self.ctx.from_polars(data, name)) - def register_table(self, name: str, table: pyarrow.Table) -> None: - """Register a table with the given name into the session. + def register_table(self, name: str, table: Table) -> None: + """Register a :py:class: `~datafusion.catalog.Table` as a table. + + The registered table can be referenced from SQL statement executed against. Args: name: Name of the resultant table. - table: PyArrow table to add to the session context. + table: DataFusion table to add to the session context. """ self.ctx.register_table(name, table) diff --git a/python/datafusion/expr.py b/python/datafusion/expr.py index 7bea0289..57fac42e 100644 --- a/python/datafusion/expr.py +++ b/python/datafusion/expr.py @@ -266,7 +266,7 @@ def __getitem__(self, key: str | int) -> Expr: If ``key`` is a string, returns the subfield of the struct. If ``key`` is an integer, retrieves the element in the array. Note that the - element index begins at ``0``, unlike `array_element` which begines at ``1``. + element index begins at ``0``, unlike `array_element` which begins at ``1``. """ if isinstance(key, int): return Expr( diff --git a/python/datafusion/functions.py b/python/datafusion/functions.py index 4c701b24..97b4fe1d 100644 --- a/python/datafusion/functions.py +++ b/python/datafusion/functions.py @@ -18,11 +18,6 @@ from __future__ import annotations -# from datafusion._internal.context import SessionContext -# from datafusion._internal.expr import Expr -# from datafusion._internal.expr.conditional_expr import CaseBuilder -# from datafusion._internal.expr.window import WindowFrame - from datafusion._internal import functions as f, common from datafusion.expr import CaseBuilder, Expr, WindowFrame from datafusion.context import SessionContext