Skip to content

Commit c87c7cc

Browse files
committed
Add explicit polars overloads
1 parent f3b8c8a commit c87c7cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_duckdb-stubs/__init__.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,11 @@ class DuckDBPyConnection:
318318
def list_type(self, type: sqltypes.DuckDBPyType) -> sqltypes.DuckDBPyType: ...
319319
def load_extension(self, extension: str) -> None: ...
320320
def map_type(self, key: sqltypes.DuckDBPyType, value: sqltypes.DuckDBPyType) -> sqltypes.DuckDBPyType: ...
321-
def pl(self, rows_per_batch: pytyping.SupportsInt = 1000000, *, lazy: bool = False) -> polars.DataFrame: ...
321+
@pytyping.overload
322+
def pl(self, rows_per_batch: pytyping.SupportsInt = 1000000, *, lazy: pytyping.Literal[False] = ...) -> polars.DataFrame: ...
323+
@pytyping.overload
324+
def pl(self, rows_per_batch: pytyping.SupportsInt = 1000000, *, lazy: pytyping.Literal[True]) -> polars.LazyFrame: ...
325+
def pl(self, rows_per_batch: pytyping.SupportsInt = 1000000, *, lazy: bool = False) -> pytyping.Union[polars.DataFrame, polars.LazyFrame]: ...
322326
def query(self, query: str, *, alias: str = "", params: object = None) -> DuckDBPyRelation: ...
323327
def query_progress(self) -> float: ...
324328
def read_csv(

0 commit comments

Comments
 (0)