@@ -40,8 +40,9 @@ if typing.TYPE_CHECKING:
4040 ColumnsTypes ,
4141 ProfilerFormat ,
4242 ParquetCompression ,
43+ ArrowUDF ,
4344 )
44- from ._enums import ExplainTypeLiteral , CSVLineTerminatorLiteral , RenderModeLiteral
45+ from ._enums import ExplainTypeLiteral , RenderModeLiteral
4546 from duckdb import sqltypes , func
4647
4748__all__ : lst [str ] = [
@@ -210,14 +211,28 @@ class DuckDBPyConnection:
210211 def checkpoint (self ) -> DuckDBPyConnection : ...
211212 def close (self ) -> None : ...
212213 def commit (self ) -> DuckDBPyConnection : ...
214+ @typing .overload
213215 def create_function (
214216 self ,
215217 name : str ,
216218 function : Callable [..., PythonLiteral ],
217219 parameters : lst [IntoPyType ] | None = None ,
218220 return_type : IntoPyType | None = None ,
219221 * ,
220- type : func .PythonUDFType = ...,
222+ type : func .PythonUDFType = func .PythonUDFType .NATIVE ,
223+ null_handling : func .FunctionNullHandling = ...,
224+ exception_handling : PythonExceptionHandling = ...,
225+ side_effects : bool = False ,
226+ ) -> DuckDBPyConnection : ...
227+ @typing .overload
228+ def create_function (
229+ self ,
230+ name : str ,
231+ function : ArrowUDF ,
232+ parameters : lst [IntoPyType ] | None = None ,
233+ return_type : IntoPyType | None = None ,
234+ * ,
235+ type : func .PythonUDFType = func .PythonUDFType .ARROW ,
221236 null_handling : func .FunctionNullHandling = ...,
222237 exception_handling : PythonExceptionHandling = ...,
223238 side_effects : bool = False ,
@@ -273,7 +288,7 @@ class DuckDBPyConnection:
273288 normalize_names : bool | None = None ,
274289 null_padding : bool | None = None ,
275290 names : lst [str ] | None = None ,
276- lineterminator : CSVLineTerminator | CSVLineTerminatorLiteral | None = None ,
291+ lineterminator : CSVLineTerminator | None = None ,
277292 columns : ColumnsTypes | None = None ,
278293 auto_type_candidates : lst [StrIntoPyType ] | None = None ,
279294 max_line_size : int | None = None ,
@@ -374,7 +389,7 @@ class DuckDBPyConnection:
374389 normalize_names : bool | None = None ,
375390 null_padding : bool | None = None ,
376391 names : lst [str ] | None = None ,
377- lineterminator : CSVLineTerminator | CSVLineTerminatorLiteral | None = None ,
392+ lineterminator : CSVLineTerminator | None = None ,
378393 columns : ColumnsTypes | None = None ,
379394 auto_type_candidates : lst [StrIntoPyType ] | None = None ,
380395 max_line_size : int | None = None ,
@@ -596,7 +611,7 @@ class DuckDBPyRelation:
596611 self , expression : str , groups : str = "" , window_spec : str = "" , projected_columns : str = ""
597612 ) -> DuckDBPyRelation : ...
598613 def map (
599- self , map_function : Callable [..., PythonLiteral ], * , schema : dict [str , sqltypes .DuckDBPyType ] | None = None
614+ self , map_function : Callable [..., typing . Any ], * , schema : dict [str , sqltypes .DuckDBPyType ] | None = None
600615 ) -> DuckDBPyRelation : ...
601616 def max (
602617 self , expression : str , groups : str = "" , window_spec : str = "" , projected_columns : str = ""
@@ -900,13 +915,27 @@ def connect(
900915 read_only : bool = False ,
901916 config : dict [str , str | bool | int | float | lst [str ]] | None = None ,
902917) -> DuckDBPyConnection : ...
918+ @typing .overload
903919def create_function (
904920 name : str ,
905921 function : Callable [..., PythonLiteral ],
906922 parameters : lst [IntoPyType ] | None = None ,
907923 return_type : IntoPyType | None = None ,
908924 * ,
909- type : func .PythonUDFType = ...,
925+ type : func .PythonUDFType = func .PythonUDFType .NATIVE ,
926+ null_handling : func .FunctionNullHandling = ...,
927+ exception_handling : PythonExceptionHandling = ...,
928+ side_effects : bool = False ,
929+ connection : DuckDBPyConnection | None = None ,
930+ ) -> DuckDBPyConnection : ...
931+ @typing .overload
932+ def create_function (
933+ name : str ,
934+ function : ArrowUDF ,
935+ parameters : lst [IntoPyType ] | None = None ,
936+ return_type : IntoPyType | None = None ,
937+ * ,
938+ type : func .PythonUDFType = func .PythonUDFType .ARROW ,
910939 null_handling : func .FunctionNullHandling = ...,
911940 exception_handling : PythonExceptionHandling = ...,
912941 side_effects : bool = False ,
@@ -1011,7 +1040,7 @@ def from_csv_auto(
10111040 normalize_names : bool | None = None ,
10121041 null_padding : bool | None = None ,
10131042 names : lst [str ] | None = None ,
1014- lineterminator : CSVLineTerminator | CSVLineTerminatorLiteral | None = None ,
1043+ lineterminator : CSVLineTerminator | None = None ,
10151044 columns : ColumnsTypes | None = None ,
10161045 auto_type_candidates : lst [StrIntoPyType ] | None = None ,
10171046 max_line_size : int | None = None ,
@@ -1160,7 +1189,7 @@ def read_csv(
11601189 normalize_names : bool | None = None ,
11611190 null_padding : bool | None = None ,
11621191 names : lst [str ] | None = None ,
1163- lineterminator : CSVLineTerminator | CSVLineTerminatorLiteral | None = None ,
1192+ lineterminator : CSVLineTerminator | None = None ,
11641193 columns : ColumnsTypes | None = None ,
11651194 auto_type_candidates : lst [StrIntoPyType ] | None = None ,
11661195 max_line_size : int | None = None ,
0 commit comments