Skip to content

Commit a0913c7

Browse files
authored
chore: fix docstrings, typos (#852)
1 parent 859acb4 commit a0913c7

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

python/datafusion/context.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def with_create_default_catalog_and_schema(
7373
def with_default_catalog_and_schema(
7474
self, catalog: str, schema: str
7575
) -> SessionConfig:
76-
"""Select a name for the default catalog and shcema.
76+
"""Select a name for the default catalog and schema.
7777
7878
Args:
7979
catalog: Catalog name.
@@ -517,7 +517,7 @@ def sql(self, query: str, options: SQLOptions | None = None) -> DataFrame:
517517
def sql_with_options(self, query: str, options: SQLOptions) -> DataFrame:
518518
"""Create a :py:class:`~datafusion.dataframe.DataFrame` from SQL query text.
519519
520-
This function will first validating that the query is allowed by the
520+
This function will first validate that the query is allowed by the
521521
provided options.
522522
523523
Args:
@@ -636,12 +636,14 @@ def from_polars(self, data: polars.DataFrame, name: str | None = None) -> DataFr
636636
"""
637637
return DataFrame(self.ctx.from_polars(data, name))
638638

639-
def register_table(self, name: str, table: pyarrow.Table) -> None:
640-
"""Register a table with the given name into the session.
639+
def register_table(self, name: str, table: Table) -> None:
640+
"""Register a :py:class: `~datafusion.catalog.Table` as a table.
641+
642+
The registered table can be referenced from SQL statement executed against.
641643
642644
Args:
643645
name: Name of the resultant table.
644-
table: PyArrow table to add to the session context.
646+
table: DataFusion table to add to the session context.
645647
"""
646648
self.ctx.register_table(name, table)
647649

python/datafusion/expr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def __getitem__(self, key: str | int) -> Expr:
266266
267267
If ``key`` is a string, returns the subfield of the struct.
268268
If ``key`` is an integer, retrieves the element in the array. Note that the
269-
element index begins at ``0``, unlike `array_element` which begines at ``1``.
269+
element index begins at ``0``, unlike `array_element` which begins at ``1``.
270270
"""
271271
if isinstance(key, int):
272272
return Expr(

python/datafusion/functions.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
from __future__ import annotations
2020

21-
# from datafusion._internal.context import SessionContext
22-
# from datafusion._internal.expr import Expr
23-
# from datafusion._internal.expr.conditional_expr import CaseBuilder
24-
# from datafusion._internal.expr.window import WindowFrame
25-
2621
from datafusion._internal import functions as f, common
2722
from datafusion.expr import CaseBuilder, Expr, WindowFrame
2823
from datafusion.context import SessionContext

0 commit comments

Comments
 (0)