Skip to content

Commit c35d434

Browse files
committed
fix: introduce TableLike type alias for improved readability in read_table method
1 parent 03842b6 commit c35d434

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/datafusion/context.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ class TableProviderExportable(Protocol):
8282
def __datafusion_table_provider__(self) -> object: ... # noqa: D105
8383

8484

85+
# Type alias for objects accepted by read_table
86+
TableLike = Table | TableProviderExportable
87+
88+
8589
class CatalogProviderExportable(Protocol):
8690
"""Type hint for object that has __datafusion_catalog_provider__ PyCapsule.
8791
@@ -1164,7 +1168,7 @@ def read_avro(
11641168
)
11651169

11661170
def read_table(
1167-
self, table: Table | TableProviderExportable
1171+
self, table: TableLike
11681172
) -> DataFrame:
11691173
"""Creates a :py:class:`~datafusion.dataframe.DataFrame` from a table.
11701174

0 commit comments

Comments
 (0)