Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix docstrings, typos #852

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading