Replies: 2 comments 3 replies
-
There is definitely a lot we can do to improve the devexp here. We're making some small steps in the direction (e.g I have a branch where I'm doing a lot of cleaning with the help of ruff) but we're a long way out. That said:
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Closing this for now, in favor of #57 . I'll update on current progress re typechecking there, discussion also welcome there. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, if I understand correctly, we
from _duckdb import *
I propose instead:
DuckDBPyConnection.create_function
has this rather terse signature:def create_function(name: str, function: function, parameters: Optional[List[DuckDBPyType]] = None, return_type: Optional[DuckDBPyType] = None, *, type: Optional[PythonUDFType] = PythonUDFType.NATIVE, null_handling: Optional[FunctionNullHandling] = FunctionNullHandling.DEFAULT, exception_handling: Optional[PythonExceptionHandling] = PythonExceptionHandling.DEFAULT, side_effects: bool = False, connection: DuckDBPyConnection = ...) -> DuckDBPyConnection: ...
, but instead this would be much more readable (and correct for mypy) in my opinion if it used egtype: Literal["native", "arrow"] = "native"
instead of the enumPythonUDFType
.mypy
to generate the suggested types, and use griffe to check for API compatibility between the two. This would almost definitely need some hand tweaking, but I think it could use the same# stubgen override
system thatregenerate_python_stubs.sh
usesI'm not sure if we could also just push the docstrings and other documentation down into the C++ layer and have pybind translate it for us?
Beta Was this translation helpful? Give feedback.
All reactions