Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors
Description
Bug report
Bug description:
The create_aggregate documentation does not specify a result type of the aggregation and even allows for multiple aggregating values per row (n_arg parameter).
However, the type declaration at dbapi2.pyi does not reflect that (comments added by me):
defcreate_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol]) ->None: ... class_AggregateProtocol(Protocol): defstep(self, value: int, /) ->object: ... # <-- just one aggregating value of type intdeffinalize(self) ->int: ... # <-- result has to be intI think that this is not correct. At least, I have working code that aggregates multiple strings into a combined one.
Also, it is in stark contrast to other, way more generic, type declarations at the same place (comments added by me):
class_AnyParamWindowAggregateClass(Protocol): defstep(self, *args: Any) ->object: ... # <-- multiple aggregating values of any type alloweddefinverse(self, *args: Any) ->object: ... defvalue(self) ->_SqliteData: ... deffinalize(self) ->_SqliteData: ... # <-- result can be many more types_SqliteData: TypeAlias=str|ReadableBuffer|int|float|NoneCPython versions tested on:
3.12
Operating systems tested on:
Windows
alex
Metadata
Metadata
Assignees
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors