Skip to content

Commit

Permalink
chore: fix docstrings, typos (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
mesejo authored Sep 6, 2024
1 parent 859acb4 commit a0913c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
12 changes: 7 additions & 5 deletions python/datafusion/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion python/datafusion/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
5 changes: 0 additions & 5 deletions python/datafusion/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a0913c7

Please sign in to comment.