We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
assignee = None
closed_at = <Date 2021-05-05.19:32:17.598>
created_at = <Date 2020-05-13.18:52:51.149>
labels = ['type-feature', 'library', '3.9']
title = 'sqlite3: expose sqlite3_create_window_function'
updated_at = <Date 2021-05-05.19:32:17.597>
user = 'https://bugs.python.org/iljau'
activity = <Date 2021-05-05.19:32:17.597>
actor = 'erlendaasland'
assignee = 'none'
closed = True
closed_date = <Date 2021-05-05.19:32:17.598>
closer = 'erlendaasland'
components = ['Library (Lib)']
creation = <Date 2020-05-13.18:52:51.149>
creator = 'iljau'
dependencies = 
files = ['49190']
hgrepos = 
issue_num = 40617
keywords = ['patch']
message_count = 6.0
messages = ['368794', '369822', '369828', '369834', '369851', '370880']
nosy_count = 3.0
nosy_names = ['berker.peksag', 'erlendaasland', 'iljau']
pr_nums = 
priority = 'normal'
resolution = 'duplicate'
stage = 'resolved'
status = 'closed'
superseder = '34916'
type = 'enhancement'
url = 'https://bugs.python.org/issue40617'
versions = ['Python 3.9']
The text was updated successfully, but these errors were encountered:
Expose sqlite3_create_window_function as sqlite3.create_window_function.
There already exists sqlite3.create_aggregate, which uses sqlite3_create_function_v2 and is conceptually similar.
Window functions are available in sqlite starting from 2018-09-15 (3.25.0) release.
Sorry, something went wrong.
This is a good idea, but I think the Python interface should stay the same.
From the user perspective, you'd only need to implement the 'value' and 'inverse' callbacks to transform your aggregate class into an aggregate window class.
From the CPython perspective, we'd only need to use sqlite3_create_window_function() instead of sqlite3_create_function_v2(), if we are compiling against SQLite 3.25.3 or newer.
I guess it would be nice to output a warning if the user aggregate class contains 'value' and 'inverse' callbacks, but sqlite3 _doesn't_ support aggregate window functions.
On a second thought and with regards to error reporting, it _would_ make sense to expose this as a function instead of embedding it into sqlite3.create_aggregate.
Please see attached patch, @iljau.
Another possibility (instead of adding sqlite3.create_window_function) is to add a "windowed" parameter to sqlite3.create_aggregate():
sqlite3.create_aggregate(name, narg, aggregate, windowed=True
Maybe that's a little bit cleaner regarding the Python interface.
Duplicate of bpo-34916
No branches or pull requests